Compare commits
2 Commits
7fc73921d3
...
4df3116475
| Author | SHA1 | Date | |
|---|---|---|---|
| 4df3116475 | |||
| 42bbe1fa21 |
@@ -1,11 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
"flag"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
|
||||
@@ -24,7 +24,7 @@ func main() {
|
||||
}
|
||||
port_arg := os.Getenv("FIB_PORT")
|
||||
if port_arg != "" {
|
||||
fmt.Printf("Loaded port value '%s' from environment.\n",port_arg)
|
||||
fmt.Printf("Loaded port value '%s' from environment.\n", port_arg)
|
||||
port_number, error = strconv.Atoi(port_arg)
|
||||
if error != nil {
|
||||
fmt.Printf("I had an error trying to parse '%s' into a number: %s\n",
|
||||
@@ -33,9 +33,9 @@ func main() {
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
flag.IntVar(&port, "port", 8098,
|
||||
flag.IntVar(&port, "port", 8098,
|
||||
fmt.Sprintf("Port number to bind to, default %d", port_number))
|
||||
flag.IntVar(&seq, "number", 0,
|
||||
flag.IntVar(&seq, "number", 0,
|
||||
"Fibonacci sequence value to calculate")
|
||||
flag.Parse()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user