The mighty, self-hostable Git server for the command line 🍦
1package test 2 3import "net" 4 5func RandomPort() int { 6 addr, _ := net.Listen("tcp", ":0") //nolint:gosec 7 _ = addr.Close() 8 return addr.Addr().(*net.TCPAddr).Port 9}