Answer the question
In order to leave comments, you need to log in
How to create lib in app?
How to create a library for an application?
For example, the user.go functions should be in lib and called through:
Implementation through packages is not suitable. Because the library becomes completely global and loses the scope of the standard functions.
Just like that from src/app/user.go, I can't put in src/app/lib/user.go. Because there are problems when compiling, in other words, it does not see the lib directory type User struct{}
go build
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question