Public IP getter loop refactored
This commit is contained in:
@@ -4,16 +4,14 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
"github.com/qdm12/gluetun/internal/params"
|
||||
)
|
||||
|
||||
// System contains settings to configure system related elements.
|
||||
type System struct {
|
||||
UID int
|
||||
GID int
|
||||
Timezone string
|
||||
IPStatusFilepath models.Filepath
|
||||
UID int
|
||||
GID int
|
||||
Timezone string
|
||||
}
|
||||
|
||||
// GetSystemSettings obtains the System settings using the params functions.
|
||||
@@ -30,10 +28,6 @@ func GetSystemSettings(paramsReader params.Reader) (settings System, err error)
|
||||
if err != nil {
|
||||
return settings, err
|
||||
}
|
||||
settings.IPStatusFilepath, err = paramsReader.GetIPStatusFilepath()
|
||||
if err != nil {
|
||||
return settings, err
|
||||
}
|
||||
return settings, nil
|
||||
}
|
||||
|
||||
@@ -43,7 +37,6 @@ func (s *System) String() string {
|
||||
fmt.Sprintf("User ID: %d", s.UID),
|
||||
fmt.Sprintf("Group ID: %d", s.GID),
|
||||
fmt.Sprintf("Timezone: %s", s.Timezone),
|
||||
fmt.Sprintf("IP Status filepath: %s", s.IPStatusFilepath),
|
||||
}
|
||||
return strings.Join(settingsList, "\n|--")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user