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...
For further actions, you may consider blocking this person and/or reporting abuse
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 calledauth
, so your functions actually becomeauth.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).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.
Nice post!