func deleteKey(session *api.Session) { pub, ok := session.User.PublicKeys["primary"] if !ok { fmt.Println("There is no public key to delete.") os.Exit(1) } err := session.DeleteKey(pub.KeyID) if err != nil { fmt.Printf("Failed to delete your public key: %v\n", err) os.Exit(1) } fmt.Println("Your public key has been deleted from your account.") }