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: check_port_others.go
    path of file: ./repos/minio/internal/http
    
    the code of the file until where you have to start completion: //go:build !linux
// +build !linux

// Copyright (c) 2015-2023 MinIO, Inc.
//
// This file is part of Min
    
func CheckPortAvailability(host, port string, opts TCPOptions) (err error) {
	lc := &net.ListenConfig{}

	ctx, cancel := context.WithTimeout(context.Background(), time.Second)
	defer cancel()

	l, err := lc.Listen(ctx, "tcp", net.JoinHostPort(host, port))
	if err != nil {
		return err
	}

	// As we are able to listen on this network, the port is not in use.
	// Close the listener and continue check other networks.
	return l.Close()
}