MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / loadConfig

Function loadConfig

main.go:97–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95}
96
97func loadConfig() properties.ServerProperties {
98 file, err := os.ReadFile("server.properties")
99 if err != nil {
100 file, err := os.Create("server.properties")
101 if err == nil {
102 properties.Marshal(file, properties.Default)
103 file.Close()
104 }
105 return properties.Default
106 }
107 var cfg properties.ServerProperties
108
109 err = properties.Unmarshal(string(file), &cfg)
110 if err != nil {
111 cfg = properties.Default
112 }
113
114 return cfg
115}

Callers 1

mainFunction · 0.85

Calls 3

MarshalFunction · 0.92
UnmarshalFunction · 0.92
CloseMethod · 0.45

Tested by

no test coverage detected