The behaviour seems to be correct for bogus service names:
$ go run main.go -service=not-a-service
US-East (Virginia) NaN ms
US-East (Ohio) NaN ms
US-West (California) NaN ms
US-West (Oregon) NaN ms
Canada (Ceentral) NaN ms
Europe (Ireland) NaN ms
Europe (Frankfurt) NaN ms
Europe (London) NaN ms
Asia Pacific (Tokyo) NaN ms
Asia Pacific (Seoul) NaN ms
Asia Pacific (Singapore) NaN ms
Asia Pacific (Mumbai) NaN ms
Asia Pacific (Sydney) NaN ms
South America (São Paulo) NaN ms
but panics for partially available services:
$ go run main.go -service=ecr
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11f4345]
goroutine 7 [running]:
main.(*AWSRegion).CheckLatencyTCP(0xc4200bc5b0, 0xc4200164d0)
/tmp/workspace/awsping/main.go:85 +0x295
created by main.CalcLatency
/tmp/workspace/awsping/main.go:141 +0x357
exit status 2
The behaviour seems to be correct for bogus service names:
but panics for partially available services: