Switch config to pointer

This commit is contained in:
Kristoffer Dalby
2022-06-05 17:47:26 +02:00
parent af891808f6
commit 78ed610b50
3 changed files with 9 additions and 9 deletions

4
app.go
View File

@@ -71,7 +71,7 @@ const (
// Headscale represents the base app of the service.
type Headscale struct {
cfg Config
cfg *Config
db *gorm.DB
dbString string
dbType string
@@ -115,7 +115,7 @@ func LookupTLSClientAuthMode(mode string) (tls.ClientAuthType, bool) {
}
}
func NewHeadscale(cfg Config) (*Headscale, error) {
func NewHeadscale(cfg *Config) (*Headscale, error) {
privKey, err := readOrCreatePrivateKey(cfg.PrivateKeyPath)
if err != nil {
return nil, fmt.Errorf("failed to read or create private key: %w", err)