move some stuff around
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
URL string `json:"url"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
var serverConfig Config
|
||||
|
||||
func read_config() {
|
||||
file, err := os.ReadFile("config.json")
|
||||
if err != nil {
|
||||
fmt.Print(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
err = json.Unmarshal(file, &serverConfig)
|
||||
if err != nil {
|
||||
fmt.Print(err.Error())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user