MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / saveGameTimeFile

Function saveGameTimeFile

internal/gametime/admin.go:86–99  ·  view source on GitHub ↗

saveGameTimeFile writes the current gameTimeData to the gametime.yaml path.

()

Source from the content-addressed store, hash-verified

84
85// saveGameTimeFile writes the current gameTimeData to the gametime.yaml path.
86func saveGameTimeFile() error {
87 path := string(configs.GetFilePathsConfig().DataFiles) + `/gametime.yaml`
88
89 data, err := yaml.Marshal(&gameTimeData)
90 if err != nil {
91 return errors.Wrap(err, "marshal gametime data")
92 }
93
94 if err := util.WriteFile(path, data, 0o644); err != nil {
95 return errors.Wrap(err, "write gametime.yaml: "+path)
96 }
97
98 return nil
99}

Callers 2

SaveCalendarFunction · 0.85
DeleteCalendarFunction · 0.85

Calls 3

GetFilePathsConfigFunction · 0.92
WriteFileFunction · 0.92
WrapMethod · 0.80

Tested by

no test coverage detected