Configuration for downloading non-public code ¶
The go command defaults to downloading modules from the public Go module mirror at proxy.golang.org. It also defaults to validating downloaded modules, regardless of source, against the public Go checksum database at sum.golang.org. These defaults work well for publicly available source code.
The GOPRIVATE environment variable controls which modules the go command considers to be private (not available publicly) and should therefore not use the proxy or checksum database. The variable is a comma-separated list of glob patterns (in the syntax of Go's path.Match) of module path prefixes. For example,
GOPRIVATE=*.corp.example.com,rsc.io/private
causes the go command to treat as private any module with a path prefix matching either pattern, including git.corp.example.com/xyzzy, rsc.io/private, and rsc.io/private/quux.
For fine-grained control over module download and validation, the GONOPROXY and GONOSUMDB environment variables accept the same kind of glob list and override GOPRIVATE for the specific decision of whether to use the proxy and checksum database, respectively.
For example, if a company ran a module proxy serving private modules, users would configure go using:
GOPRIVATE=*.corp.example.com
GOPROXY=proxy.example.com
GONOPROXY=none
Les interfaces en go c'est vraiment pas simple ... Pour citer l'article :
Go’s interfaces are one of it’s best features, but they’re also one of the most confusing for newbies.
mais l'exemple est assez parlant :
type Walker interface {
Walk(miles int)
}
type Camel struct {
Name string
}
func (c Camel) Walk(miles int) {
fmt.Printf(“%s is walking %v miles\n”, c.Name, miles)
}
func LongWalk(w Walker) {
w.Walk(500)
w.Walk(500)
}
func main() {
c := Camel{“Bill”}
LongWalk(c)
}
// prints
// Bill is walking 500 miles.
// Bill is walking 500 miles.
Un très bon example ELI5 de goroutines, c'est plus simple de l'expliquer sans channel en fait ... enfin c'est plus simple de le comprendre :D
Une page qui explique très bien ce qu'est une interface !
Un fucking fichier qui permet d'apprendre go assez rapidement :) so far so clear, en français en plus. Ca va me faciliter la vie tout ça