Skip to content

Commit ebad441

Browse files
committed
fix type conversation
1 parent 2d53903 commit ebad441

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/config/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var (
2525
defaultWatchdogInterval = uint(0) // watchdog interval in seconds (0 to disable)
2626
defaultStopOnWatchdog = false // set to true to stop the program when the socket gets unavailable (otherwise log only)
2727
defaultProxySocketEndpoint = "" // empty string means no socket listener, but regular TCP listener
28-
defaultProxySocketEndpointFileMode = 0400 // set the file mode of the unix socket endpoint
28+
defaultProxySocketEndpointFileMode = uint(0400) // set the file mode of the unix socket endpoint
2929
)
3030

3131
type Config struct {
@@ -72,7 +72,7 @@ func InitConfig() (*Config, error) {
7272
listenIP string
7373
proxyPort uint
7474
logLevel string
75-
endpointFileMode int
75+
endpointFileMode uint
7676
)
7777

7878
if val, ok := os.LookupEnv("SP_ALLOWFROM"); ok && val != "" {
@@ -122,7 +122,7 @@ func InitConfig() (*Config, error) {
122122
}
123123
if val, ok := os.LookupEnv("SP_PROXYSOCKETENDPOINTFILEMODE"); ok {
124124
if parsedVal, err := strconv.ParseUint(val, 8, 32); err == nil {
125-
defaultProxySocketEndpointFileMode = uint32(parsedVal)
125+
defaultProxySocketEndpointFileMode = uint(parsedVal)
126126
}
127127
}
128128

@@ -143,7 +143,7 @@ func InitConfig() (*Config, error) {
143143
flag.BoolVar(&cfg.StopOnWatchdog, "stoponwatchdog", defaultStopOnWatchdog, "stop the program when the socket gets unavailable (otherwise log only)")
144144
flag.UintVar(&cfg.WatchdogInterval, "watchdoginterval", defaultWatchdogInterval, "watchdog interval in seconds (0 to disable)")
145145
flag.StringVar(&cfg.ProxySocketEndpoint, "proxysocketendpoint", defaultProxySocketEndpoint, "unix socket endpoint (if set, used instead of the TCP listener)")
146-
flag.IntVar(&endpointFileMode, "proxysocketendpointfilemode", defaultProxySocketEndpointFileMode, "set the file mode of the unix socket endpoint")
146+
flag.UintVar(&endpointFileMode, "proxysocketendpointfilemode", defaultProxySocketEndpointFileMode, "set the file mode of the unix socket endpoint")
147147
for i := 0; i < len(mr); i++ {
148148
flag.StringVar(&mr[i].regexStringFromParam, "allow"+mr[i].method, "", "regex for "+mr[i].method+" requests (not set means method is not allowed)")
149149
}

0 commit comments

Comments
 (0)