Skip to content

Commit 1cc18b6

Browse files
authored
Merge pull request #14 from kubernetli/bug/timeout
Update args.go
2 parents 359ef93 + 9b787d1 commit 1cc18b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cmd/fmcCLI/args.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type Args struct {
1414
Function string
1515
Cert string
1616
Input string
17-
Timeout string
17+
Timeout int
1818
}
1919

2020
// reads/parses user input .
@@ -27,7 +27,7 @@ func args() *Args {
2727
userPtr := flag.String("user", "admin", "API Username")
2828
pwPtr := flag.String("pw", "admin", "Username Password")
2929
fmcCertPtr := flag.String("cert", "", "adding x509 Certificate if client does not trust the fmc certificate")
30-
timeoutPtr := flag.String("timeout", "60", "timeout")
30+
timeoutPtr := flag.Int("timeout", 60, "timeout")
3131

3232
flag.Parse()
3333
return &Args{

cmd/fmcCLI/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func main() {
4242
}
4343

4444
//increase http timeout
45-
t.HTTPClient.Timeout = time.Minute * arg.Timeout
45+
t.HTTPClient.Timeout = time.Minute * time.Duration(arg.Timeout)
4646

4747
// run function
4848
switch arg.Function {

0 commit comments

Comments
 (0)