DEV Community

My Journey into Go

Mike on February 22, 2018

I've always admired Go, it's a simplistic language, and I finally decided to give it a try. After numerous failures to understand how Go actually w...
Collapse
 
matteojoliveau profile image
Matteo Joliveau

It is more idiomatic in Go to have the package name act as the domain/namespace indicator.
I noticed your functions all begin with "auth". It would be correct to put auth_service.go in a package called auth, so your functions actually become auth.CheckPassword(), auth.Login() etc. (Notice the capital letter on the function names. In Go, a function with a capital is public, otherwise it is package-private).

Collapse
 
inkeliz profile image
Inkeliz • Edited

I think you can use an more secure password derivation, the Argon2, which was the winner of PHC

The Golang has the Argon2i and Argon2id "natively" under "golang.org/x/crypto/argon2", godoc.org/golang.org/x/crypto/argon2. If you need to use the Argon2d, for some reason, you can modify the API too.

Collapse
 
iridakos profile image
Lazarus Lazaridis

Nice post!