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

Function Marshal

properties/encode.go:12–20  ·  view source on GitHub ↗

Marshal encodes the properties file

(dst io.Writer, p any)

Source from the content-addressed store, hash-verified

10
11// Marshal encodes the properties file
12func Marshal(dst io.Writer, p any) error {
13 val := reflect.ValueOf(p)
14 switch val.Kind() {
15 case reflect.Struct:
16 return encodePropsStruct(dst, val)
17 default:
18 return fmt.Errorf("Marshal excepts a struct or map, not %s", val.Kind())
19 }
20}
21
22func encodePropsStruct(dst io.Writer, v reflect.Value) error {
23 vt := v.Type()

Callers 1

loadConfigFunction · 0.92

Calls 1

encodePropsStructFunction · 0.85

Tested by

no test coverage detected