June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
package global import ( "errors" "os" "sync" "github.com/sirupsen/logrus" ) // we make our global package level // variable lower case var ( log *logrus.Logger initLog sync.Once ) // Init sets up the logger intially // if run multiple times, it returns // an error func Init() error { err := errors.New("already initialized") initLog.Do(func() { err = nil log = logrus.New() ...Read now
Unlock full access