Re: [go-nuts] Best practice for "main.go" to access members of a structure in the real package

2023-02-27 Thread Wojciech S. Czarnecki
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

Re: [go-nuts] Best practice for "main.go" to access members of a structure in the real package

2023-02-26 Thread Marcin Romaszewicz
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

[go-nuts] Best practice for "main.go" to access members of a structure in the real package

2023-02-17 Thread Pat Farrell
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