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: blackmagic.go
    path of file: ./repos/corteza/extra/server-discovery/vendor/github.com/lestrrat-go/blackmagic
    
    the code of the file until where you have to start completion: package blackmagic

import (
	"fmt"
	"reflect"
)

// AssignField is a convenience function to assign a value to
// an optional struct field. In Go, an optional struct field is
// usually denoted by a pointer to T instead of T:
//
//	type Object struct {
//	  Optional *T
//	}
//
// This gets a bit cumbersome when you want to assign literals
// or you do not want to worry about taking the address of a
// variable.
//
//	Object.Optional = &"foo" // doesn't compile!
//
// Instead you can use this function to do it in one line:
//
//	blackma
    
func AssignOptionalField(dst, src interface{}) error {
	dstRV := reflect.ValueOf(dst)
	srcRV := reflect.ValueOf(src)
	if dstRV.Kind() != reflect.Pointer || dstRV.Elem().Kind() != reflect.Pointer {
		return fmt.Errorf(`dst must be a pointer to a field that is turn a pointer of src (%T)`, src)
	}

	if !dstRV.Elem().CanSet() {
		return fmt.Errorf(`dst (%T) is not assignable`, dstRV.Elem().Interface())
	}
	if !reflect.PtrTo(srcRV.Type()).AssignableTo(dstRV.Elem().Type()) {
		return fmt.Errorf(`cannot assign src (%T) to dst (%T)`, src, dst)
	}

	ptr := reflect.New(srcRV.Type())
	ptr.Elem().Set(srcRV)
	dstRV.Elem().Set(ptr)
	return nil
}