Dnia 2023-02-17, o godz. 19:18:23
Pat Farrell napisaĆ(a):
> Which is a good start. It works great if I capitalize all the variables.
> But I really don't want to make all of the variables in the struct be part
> of my public API.
then make GetSmth methods on that struct. That will be your
Go doesn't have file scoped variables, only global variables and local
variables declared in functions, so your "file" scope variables are global
to their package.
Global variables aren't inherently bad, that's a bit of voodoo that some
ideological languages introduced, and people believe without
I'm still struggling with how to setup my access.
I'm building a library, say tagtool and it has a nice clean subdirectory
with the files
that make up the go package, each with
package tagtool
And I have a subdirectory called "cmd" that contains a near trivial main.go
that calls the various