Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / staticcheck / testdata / src / CheckListenAddress / CheckListenAddress.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckListenAddress/CheckListenAddress.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckListenAddress/CheckListenAddress.go
new file mode 100644 (file)
index 0000000..4a1b04f
--- /dev/null
@@ -0,0 +1,14 @@
+package pkg
+
+import "net/http"
+
+func fn() {
+       // Seen in actual code
+       http.ListenAndServe("localhost:8080/", nil) // want `invalid port or service name in host:port pair`
+       http.ListenAndServe("localhost", nil)       // want `invalid port or service name in host:port pair`
+       http.ListenAndServe("localhost:8080", nil)
+       http.ListenAndServe(":8080", nil)
+       http.ListenAndServe(":http", nil)
+       http.ListenAndServe("localhost:http", nil)
+       http.ListenAndServe("local_host:8080", nil)
+}