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: ping.go
    path of file: ./repos/scan4all/pkg/naabu/v2/pkg/scan
    
    the code of the file until where you have to start completion: package scan

import (
	"errors"
	"net"
	"os"
	"time"

	"golang.org/x/net/icmp"
	"golang.org/x/net/ipv4"
)

// Some constants
const (
	DeadlineSec  = 10
	ProtocolICMP = 1
)

// PingResult contains the results for the Ping request
type PingResult struct {
	Hosts []Ping
}

// Ping contains the results for ping on a single host
type Ping struct {
	Type    PingResultType
	Latency time.Duration
	Error   error

    
func (p *PingResult) GetFastestHost() (Ping, error) {
	var ping Ping

	// If the latency of the current host is less than the
	// host selected and host is active, use the host that has least latency.
	for _, host := range p.Hosts {
		if (host.Latency < ping.Latency || ping.Latency == 0) && host.Type == HostActive {
			ping.Type = HostActive
			ping.Latency = host.Latency
			ping.Host = host.Host
		}
	}

	if ping.Type != HostActive {
		return ping, errors.New("no active host found for target")
	}
	return ping, nil
}