コード例 #1
0
ファイル: driver.go プロジェクト: 4shome/go.jiri
func logResult(ctx *tool.Context, action string, mgr profiles.Manager, target profiles.Target, err error) {
	fmt.Fprintf(ctx.Stdout(), "%s: %s %s: ", action, mgr.Name(), target)
	if err == nil {
		fmt.Fprintf(ctx.Stdout(), "success\n")
	} else {
		fmt.Fprintf(ctx.Stdout(), "%v\n", err)
	}
}
コード例 #2
0
ファイル: manager.go プロジェクト: vanadium/go.jiri
// Register is used to register a profile manager. It is an error
// to call Registerr more than once with the same name, though it
// is possible to register the same Manager using different names.
func Register(mgr profiles.Manager) {
	registry.Lock()
	defer registry.Unlock()
	qualifiedName := profiles.QualifiedProfileName(mgr.Installer(), mgr.Name())
	if _, present := registry.managers[qualifiedName]; present {
		panic("a profile manager is already registered for: " + qualifiedName)
	}
	registry.managers[qualifiedName] = mgr
}
コード例 #3
0
ファイル: profile_manager.go プロジェクト: vanadium/go.jiri
func logResult(jirix *jiri.X, action string, mgr profiles.Manager, target profiles.Target, err error) {
	fmt.Fprintf(jirix.Stdout(), "%s: %s %s: ", action, profiles.QualifiedProfileName(mgr.Installer(), mgr.Name()), target)
	if err == nil {
		fmt.Fprintf(jirix.Stdout(), "success\n")
	} else {
		fmt.Fprintf(jirix.Stdout(), "%v\n", err)
	}
}