Skip to content

Commit f140078

Browse files
committed
Cleaned up code using golint.
1 parent d046e00 commit f140078

File tree

3 files changed

+42
-15
lines changed

3 files changed

+42
-15
lines changed

.gitignore

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Compiled Object files, Static and Dynamic libs (Shared Objects)
2+
*.o
3+
*.a
4+
*.so
5+
6+
# Folders
7+
_obj
8+
_test
9+
10+
# Architecture specific extensions/prefixes
11+
*.[568vq]
12+
[568vq].out
13+
14+
*.cgo1.go
15+
*.cgo2.c
16+
_cgo_defun.c
17+
_cgo_gotypes.go
18+
_cgo_export.*
19+
20+
_testmain.go
21+
22+
*.exe
23+
*.test
24+
*.prof
25+
srcli
26+
main

models.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ type LensSchedule struct {
10961096
// Friend holds data about a Snapchat friend action.
10971097
type Friend struct {
10981098
Message string `json:"message"`
1099-
Param string `json:param`
1099+
Param string `json:"param"`
11001100
Object struct {
11011101
Name string `json:"name"`
11021102
UserID string `json:"user_id"`

srcli/main.go

+15-14
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@ Commands:
4747
teehee Just...
4848
4949
Options:
50-
-h --help Show this screen.
50+
-a --about About this program.
5151
-d --debug Debug output. (Requires proxy server)
52-
-f <FILE> A registration file .json
52+
-f <FILE> A registration file (.json)
53+
-h --help Show this screen.
5354
-p <PROXY> Proxy URL.
5455
56+
--captcha Use captcha verification. (default)
5557
--phone <number> Use phone verification.
56-
--captcha Use captcha verification. (Default)
5758
--version Show version.
5859
`
5960

@@ -112,7 +113,7 @@ func main() {
112113
proxy = ""
113114
}
114115

115-
if opts["about"] == true {
116+
if opts["about"] == true || opts["--about"] == true || opts["-a"] == true {
116117
fmt.Println("Snapchat Registration CLI " + version + " by Wesley Hill (@hako/@hakobyte)")
117118
return
118119
}
@@ -267,7 +268,7 @@ func main() {
267268
}
268269

269270
} else {
270-
fmt.Println("Aborted.")
271+
fmt.Println("Cancelled.")
271272
os.Exit(0)
272273
}
273274
}
@@ -412,27 +413,27 @@ func manualSetup(opts map[string]interface{}) (string, error) {
412413
rl.SetPrompt("Enter your desired Snapchat username: ")
413414
username, err := rl.Readline()
414415
if err != nil {
415-
return "", err
416+
return "", errors.New("Cancelled.")
416417
}
417418

418419
// Enter your desired password.
419420
password, err := enterPassword("Enter your desired Snapchat password: ")
420421
if err != nil {
421-
return "", err
422+
return "", errors.New("Cancelled.")
422423
}
423424

424425
// Enter your email address.
425426
rl.SetPrompt("Enter your email address: ")
426427
email, err := rl.Readline()
427428
if err != nil {
428-
return "", err
429+
return "", errors.New("Cancelled.")
429430
}
430431

431432
// Enter your birthday.
432433
rl.SetPrompt("Enter your birthday (YYYY-MM-DD): ")
433434
birthday, err := rl.Readline()
434435
if err != nil {
435-
return "", err
436+
return "", errors.New("Cancelled.")
436437
}
437438

438439
age, err := ghost.CalculateAge(birthday)
@@ -444,27 +445,27 @@ func manualSetup(opts map[string]interface{}) (string, error) {
444445
rl.SetPrompt("Enter your Gmail address: ")
445446
gmail, err := rl.Readline()
446447
if err != nil {
447-
return "", err
448+
return "", errors.New("Cancelled.")
448449
}
449450

450451
// Enter your Gmail password.
451452
gmailPassword, err := enterPassword("Enter your Gmail password: ")
452453
if err != nil {
453-
return "", err
454+
return "", errors.New("Cancelled.")
454455
}
455456

456457
// Enter your Casper API Key.
457458
rl.SetPrompt("Enter your Casper API Key: ")
458459
casperAPIKey, err := rl.Readline()
459460
if err != nil {
460-
return "", err
461+
return "", errors.New("Cancelled.")
461462
}
462463

463464
// Enter your Casper API Secret.
464465
rl.SetPrompt("Enter your Casper API Secret: ")
465466
casperAPISecret, err := rl.Readline()
466467
if err != nil {
467-
return "", err
468+
return "", errors.New("Cancelled.")
468469
}
469470

470471
// Unchecked setup map.
@@ -546,7 +547,7 @@ func checkKeys(keyMap map[string]string) (map[string]string, error) {
546547
// checkYesNo checks if the user typed yes or no from a string.
547548
// It returns a standard Y/N if a similar string exists in an array.
548549
func checkYesNo(choice string) (string, error) {
549-
var exists bool = false
550+
var exists = false
550551

551552
// Check for Yeses.
552553
for _, c := range []string{"Y", "y", "Yes", "YES", "yes"} {

0 commit comments

Comments
 (0)