You completely misunderstand.

The library the person linked is to deal with systemd credentials in go.

The two lines of code I wrote are the same, and in fact are effectively 100% of the code in the library.

Oh I see.