我想用一段命令行在 Go 中设置日期时间, 但是下面的代码失败了

datetime := "2021-06-17 18:20:41.8"
sudoPassword := "xxxxx"
app := "echo"
arg0 := sudoPassword
arg1 := "|sudo -S"
arg2 := "date"
arg3 := "-s"
arg4 := "\"" + datetime + "\""
cmd := exec.Command(app, arg0, arg1, arg2, arg3, arg4)

有没有正确的方法来做到这一点?像 Python 一样自动填写密码

os.system('echo %s|sudo -S %s' % (sudoPassword, command))