(timezone string)
| 72 | } |
| 73 | |
| 74 | func UpdateSystemTimeZone(timezone string) error { |
| 75 | system := runtime.GOOS |
| 76 | if system == "linux" { |
| 77 | cmdMgr := cmd.NewCommandMgr() |
| 78 | if err := cmdMgr.RunWithOptionalSudo("timedatectl", "set-timezone", timezone); err != nil { |
| 79 | return fmt.Errorf("update system time zone failed, %v", err) |
| 80 | } |
| 81 | return nil |
| 82 | } |
| 83 | return fmt.Errorf("the current system architecture %v does not support synchronization", system) |
| 84 | } |
nothing calls this directly
no test coverage detected