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: merge.go
    path of file: ./repos/ko/vendor/sigs.k8s.io/kind/pkg/cluster/internal/kubeconfig/internal/kubeconfig
    
    the code of the file until where you have to start completion: /*
Copyright 2019 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance w
    
func merge(existing, kind *Config) error {
	// verify assumptions about kubeadm / kind kubeconfigs
	if err := checkKubeadmExpectations(kind); err != nil {
		return err
	}

	// insert or append cluster entry
	shouldAppend := true
	for i := range existing.Clusters {
		if existing.Clusters[i].Name == kind.Clusters[0].Name {
			existing.Clusters[i] = kind.Clusters[0]
			shouldAppend = false
		}
	}
	if shouldAppend {
		existing.Clusters = append(existing.Clusters, kind.Clusters[0])
	}

	// insert or append user entry
	shouldAppend = true
	for i := range existing.Users {
		if existing.Users[i].Name == kind.Users[0].Name {
			existing.Users[i] = kind.Users[0]
			shouldAppend = false
		}
	}
	if shouldAppend {
		existing.Users = append(existing.Users, kind.Users[0])
	}

	// insert or append context entry
	shouldAppend = true
	for i := range existing.Contexts {
		if existing.Contexts[i].Name == kind.Contexts[0].Name {
			existing.Contexts[i] = kind.Contexts[0]
			shouldAppend = false
		}
	}
	if shouldAppend {
		existing.Contexts = append(existing.Contexts, kind.Contexts[0])
	}

	// set the current context
	existing.CurrentContext = kind.CurrentContext

	// TODO: We should not need this, but it allows broken clients that depend
	// on apiVersion and kind to work. Notably the upstream javascript client.
	// See: https://github.com/kubernetes-sigs/kind/issues/1242
	if len(existing.OtherFields) == 0 {
		// TODO: Should we be deep-copying? for now we don't need to
		// and doing so would be a pain (re and de-serialize maybe?) :shrug:
		existing.OtherFields = kind.OtherFields
	}

	return nil
}