package main
import (
"fmt"
"net"
)
func main() {
// s := "[::1]:9000"
s := "localhost:9000"
host, port, err := net.SplitHostPort(s)
if err != nil {
fmt.Printf("error: %s\n", err)
} else {
fmt.Printf("host: %s, port: %s\n", host, port)
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: