refactor(config): rename package _config to config with cfg alias

The config package used `package _config` with a leading underscore,
which is unconventional in Go. Rename to `package config` (matching the
directory name) and use `cfg` as the standard import alias across all
93 importing files.
This commit is contained in:
Houmgaor
2026-02-21 13:20:15 +01:00
parent ad73f2fb55
commit f17cb96b52
98 changed files with 719 additions and 719 deletions

View File

@@ -8,7 +8,7 @@ import (
"erupe-ce/common/byteframe"
"erupe-ce/common/mhfcourse"
_config "erupe-ce/config"
cfg "erupe-ce/config"
"erupe-ce/network/binpacket"
"erupe-ce/network/mhfpacket"
)
@@ -317,40 +317,40 @@ func TestBinaryMessageTypes(t *testing.T) {
func TestSlicesContainsUsage(t *testing.T) {
tests := []struct {
name string
items []_config.Course
target _config.Course
items []cfg.Course
target cfg.Course
expected bool
}{
{
name: "item_exists",
items: []_config.Course{
items: []cfg.Course{
{Name: "Course1", Enabled: true},
{Name: "Course2", Enabled: false},
},
target: _config.Course{Name: "Course1", Enabled: true},
target: cfg.Course{Name: "Course1", Enabled: true},
expected: true,
},
{
name: "item_not_found",
items: []_config.Course{
items: []cfg.Course{
{Name: "Course1", Enabled: true},
{Name: "Course2", Enabled: false},
},
target: _config.Course{Name: "Course3", Enabled: true},
target: cfg.Course{Name: "Course3", Enabled: true},
expected: false,
},
{
name: "empty_slice",
items: []_config.Course{},
target: _config.Course{Name: "Course1", Enabled: true},
items: []cfg.Course{},
target: cfg.Course{Name: "Course1", Enabled: true},
expected: false,
},
{
name: "enabled_mismatch",
items: []_config.Course{
items: []cfg.Course{
{Name: "Course1", Enabled: true},
},
target: _config.Course{Name: "Course1", Enabled: false},
target: cfg.Course{Name: "Course1", Enabled: false},
expected: false,
},
}
@@ -681,7 +681,7 @@ func BenchmarkHandleMsgSysCastBinary(b *testing.B) {
// BenchmarkSlicesContains benchmarks the slices.Contains function
func BenchmarkSlicesContains(b *testing.B) {
courses := []_config.Course{
courses := []cfg.Course{
{Name: "Course1", Enabled: true},
{Name: "Course2", Enabled: false},
{Name: "Course3", Enabled: true},
@@ -689,7 +689,7 @@ func BenchmarkSlicesContains(b *testing.B) {
{Name: "Course5", Enabled: true},
}
target := _config.Course{Name: "Course3", Enabled: true}
target := cfg.Course{Name: "Course3", Enabled: true}
b.ResetTimer()
for i := 0; i < b.N; i++ {