MCPcopy Index your code
hub / github.com/kataras/iris / createGlobalConfiguration

Function createGlobalConfiguration

configuration_test.go:93–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

91}
92
93func createGlobalConfiguration(t *testing.T) {
94 filename := homeConfigurationFilename(".yml")
95 c, err := parseYAML(filename)
96 if err != nil {
97 // this error will be occurred the first time that the configuration
98 // file doesn't exist.
99 // Create the YAML-ONLY global configuration file now using the default configuration 'c'.
100 // This is useful when we run multiple iris servers that share the same
101 // configuration, even with custom values at its "Other" field.
102 out, err := yaml.Marshal(&c)
103
104 if err == nil {
105 err = os.WriteFile(filename, out, os.FileMode(0666))
106 }
107 if err != nil {
108 t.Fatalf("error while writing the global configuration field at: %s. Trace: %v\n", filename, err)
109 }
110 }
111}
112
113func TestConfigurationGlobal(t *testing.T) {
114 t.Cleanup(func() {

Callers 1

TestConfigurationGlobalFunction · 0.85

Calls 4

parseYAMLFunction · 0.85
FatalfMethod · 0.80
MarshalMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…