You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: address.go
    path of file: ./repos/grafana/pkg/infra/network
    
    the code of the file until where you have to start completion: package network

import (
	"fmt"
	"net"
	"regexp"
)

var reIPv4AndPort = regexp.MustCompile(`^(\d+\.\d+\.\d+\.\d
    
func GetIPFromAddress(input string) (net.IP, error) {
	if a := net.ParseIP(input); len(a) > 0 {
		return a, nil
	}

	err := fmt.Errorf("not a valid IP address or IP address/port pair: %q", input)

	// It could potentially be an IP address/port pair
	var addr string
	ms := reIPv4AndPort.FindStringSubmatch(input)
	if len(ms) == 0 {
		ms := reIPv6AndPort.FindStringSubmatch(input)
		if len(ms) == 0 {
			return nil, err
		}

		addr = ms[1]
	} else {
		// Strip off port
		addr = ms[1]
	}

	if a := net.ParseIP(addr); len(a) > 0 {
		return a, nil
	}

	return nil, err
}