Hi, I appreciate the effort of creating this, but it contains quite many errors and if some beginner tries to follow these steps she will be blocked by them.
In the step 2) the pathGQL variable is not defined
You're creating file pkg/srv/main.go but then referring to pkg/server
In the last step you should refer to cmd/server/main.go but you referre to cmd/gql-server/main.go.
On points 1 and 2, you're right, good catches, I've fixed that missing variable and typo now.
I saw what you meant, on point 3, pointing to the right file right now.
Let me tell you that I've marked the post for advanced programmers for that reason, we all can err != nil from time to time and that's why I'm sharing, and that helps all us improve.
So, we created this file cmd/gql-server/main.go, then we are moving that files logic to pkg/server/main.go and calling the exposed Run() function. Afterwards we add this utility which helps to read from .env file. However, we then are using these utility functions back in cmd/gql-server/main.go where we have Server.run(). I suppose we need to modify the file in pkg folder.
Am I missing something? I'm just trying to follow the guide.
Sorry if my initial comment sounded rude, didn't intend to that.
Hi, I appreciate the effort of creating this, but it contains quite many errors and if some beginner tries to follow these steps she will be blocked by them.
pathGQL
variable is not definedpkg/srv/main.go
but then referring topkg/server
cmd/server/main.go
but you referre tocmd/gql-server/main.go
.Hi Michael, thanks for replying!
On points 1 and 2, you're right, good catches, I've fixed that missing variable and typo now.
I saw what you meant, on point 3, pointing to the right file right now.
Let me tell you that I've marked the post for advanced programmers for that reason, we all can
err != nil
from time to time and that's why I'm sharing, and that helps all us improve.So what was the point of changing that file to that one-liner if you then modifying it to the initial code with small changes?
Sorry, which one liner?
EDIT: Now should be pointing to the right file, everything should make sense now.
So, we created this file
cmd/gql-server/main.go
, then we are moving that files logic topkg/server/main.go
and calling the exposedRun()
function. Afterwards we add this utility which helps to read from.env
file. However, we then are using these utility functions back incmd/gql-server/main.go
where we haveServer.run()
. I suppose we need to modify the file inpkg
folder.Am I missing something? I'm just trying to follow the guide.
Sorry if my initial comment sounded rude, didn't intend to that.
Yes you were correct, I've modified the source according your observations, thank you Michael!