INNER CODE UNIT · Go

f

superedge/superedge · hack/update-lite-apiserver/main.go:65

	f := func(action string) func(string, string, chan<- string) (int, error) {
		switch action {
		case "start":
			return systemctl.StartUnit
		case "stop":
			return systemctl.StopUnit
		case "restart":
			return systemctl.RestartUnit
		default:
			fmt.Printf("no such action: %s\n", action)
			os.Exit(1)
		}
		return nil
	}(action)
	ch := make(chan string)
	defer close(ch)
	if _, err := f(service, "replace", ch); err != nil {
		fmt.Printf("systemctl %s %s failed: %s\n", action, service, err.Error())

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…