import ( "fmt" "github.com/juju/juju/agent" ) func main() { cfg, err := agent.ReadConfig(".juju/juju.yaml") if err != nil { panic(err) } fmt.Printf("DataDir: %s\n", cfg.DataDir) }
import ( "github.com/juju/juju/agent" ) func main() { cfg := &agent.Config{ DataDir: "/var/juju", } err := agent.WriteConfig(cfg, "/etc/juju/juju.yaml") if err != nil { panic(err) } }The package library for this code is github.com/juju/juju/agent.