+23
config/config.go
+23
config/config.go
···
···
1
+
package config
2
+
3
+
import (
4
+
"os"
5
+
6
+
"github.com/BurntSushi/toml"
7
+
)
8
+
9
+
type (
10
+
Config struct {
11
+
Fabric Loader `toml:fabric`
12
+
}
13
+
Loader struct {
14
+
Mods map[string]string `toml:mods`
15
+
}
16
+
)
17
+
18
+
func LoadConfig() (Config) {
19
+
file, _ := os.ReadFile("config.toml")
20
+
var config Config
21
+
toml.Decode(string(file), &config)
22
+
return config
23
+
}
+5
go.mod
+5
go.mod
+2
go.sum
+2
go.sum