32 lines
452 B
Go
32 lines
452 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
"os"
|
||
|
|
||
|
"git.janky.solutions/finn/lockserver/config"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
if err := writeConfig("lockserver.defaults.json"); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func writeConfig(path string) error {
|
||
|
f, err := os.Create(path)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
defer f.Close()
|
||
|
|
||
|
encoder := json.NewEncoder(f)
|
||
|
encoder.SetIndent("", " ")
|
||
|
|
||
|
if err := encoder.Encode(config.C); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|