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: server_others.go
    path of file: ./repos/kubeedge/edge/pkg/devicetwin/dmiserver
    
    the code of the file until where you have to start completion: //go:build !windows

package dmiserver

import (
	"fmt"
	"os"

	"k8s.io/klog/v2"
)

func initSock(sockPath string
    
func initSock(sockPath string) error {
	klog.Infof("init uds socket: %s", sockPath)
	_, err := os.Stat(sockPath)
	if err == nil {
		err = os.Remove(sockPath)
		if err != nil {
			return err
		}
		return nil
	} else if os.IsNotExist(err) {
		return nil
	} else {
		return fmt.Errorf("fail to stat uds socket path")
	}
}