Skip to main content

All Questions

Tagged with
1 vote
1 answer
2k views

Should Golang interface be shared among different packages of an application?

I'm developing a Go application that has lots of packages. Many of the packages use the same type from a 3rd party library. Should an interface be defined for the type in each package, and let the ...
Hans's user avatar
  • 29
4 votes
2 answers
889 views

Displaying IP addresses in Go using Stringer interface

I am trying out some Go code examples (while coding a private project) to get more "in-depth" knowledge about the language. I have come across an exercise from the Go Tour website about displaying ...
Guilherme Ferreira's user avatar
4 votes
1 answer
8k views

Writing to a file in Golang across concurrent go routines

I've been reading around how golang writes to a file, and this stack overflow question and this reddit question highlights the fact Go doesn't gurantee atomicity when writing to a file system. ...
Rambatino's user avatar
  • 243
5 votes
1 answer
84 views

Fetching files or directories in a given directory

This is a self-teaching implementation to get files for a given directory in order to simplify os.Walk in Go (avoid to pass a func for recursively walking across ...
Natalie Perret's user avatar