this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: Allow for 'dev' to be a mode

Previously the string had to be 'development' now either should work.

+27 -1
+1 -1
conf/config.yaml
··· 3 3 username: tumble 4 4 host: 127.0.0.1:13306 5 5 baseurl: localhost:8080 6 - mode: development 6 + mode: dev 7 7 logging: 8 8 level: debug 9 9 output: tumble.log
+5
internal/config/config.go
··· 64 64 return nil, fmt.Errorf("failed to unmarshal config: %w", err) 65 65 } 66 66 67 + // Normalize Mode 68 + if cfg.Mode == "dev" { 69 + cfg.Mode = "development" 70 + } 71 + 67 72 return &cfg, nil 68 73 } 69 74
+21
internal/config/config_test.go
··· 1 + package config 2 + 3 + import ( 4 + "os" 5 + "testing" 6 + ) 7 + 8 + func TestLoad_DevAlias(t *testing.T) { 9 + // Set environment variable for test 10 + os.Setenv("TUMBLE_MODE", "dev") 11 + defer os.Unsetenv("TUMBLE_MODE") 12 + 13 + cfg, err := Load("") 14 + if err != nil { 15 + t.Fatalf("Failed to load config: %v", err) 16 + } 17 + 18 + if cfg.Mode != "development" { 19 + t.Errorf("Expected Mode to be 'development', got '%s'", cfg.Mode) 20 + } 21 + }