packagecmdimport("fmt""os""dfss/dfssc/security""dfss/dfssc/user""github.com/spf13/cobra""github.com/spf13/viper")varunregisterCmd=&cobra.Command{Use:"unregister",Short:"delete current client information on platform",Run:func(cmd*cobra.Command,args[]string){// Read info from provided certificatecert,err:=security.GetCertificate(viper.GetString("file_cert"))iferr!=nil{fmt.Fprintln(os.Stderr,"An error occurred:",err.Error())os.Exit(2)}// ConfirmationvarreadystringreadStringParam("Do you REALLY want to delete "+cert.Subject.CommonName+"? Type 'yes' to confirm","",&ready)ifready!="yes"{fmt.Println("Unregistering aborted!")os.Exit(1)}err=user.Unregister()iferr!=nil{fmt.Fprintln(os.Stderr,"Error: cannot unregister:",err.Error())os.Exit(2)}},}