Example #1
0
func NewSession(verboseInstall bool) *session {
	return &session{
		t:              translator.New(),
		verboseInstall: verboseInstall,
		packages:       make(map[string]*packageData),
	}
}
Example #2
0
func NewSession(verbose bool, watch bool) *session {
	s := &session{
		t:        translator.New(),
		verbose:  verbose || watch,
		packages: make(map[string]*packageData),
	}
	if watch {
		var err error
		s.watcher, err = fsnotify.NewWatcher()
		if err != nil {
			panic(err)
		}
	}
	return s
}