@@ -351,6 +351,7 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) {
351351
352352 if head == nil || balance == nil {
353353 // Report the faucet offline until initial stats are ready
354+ //lint:ignore ST1005 This error is to be displayed in the browser
354355 if err = sendError (conn , errors .New ("Faucet offline" )); err != nil {
355356 log .Warn ("Failed to send faucet error to client" , "err" , err )
356357 return
@@ -392,6 +393,7 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) {
392393 continue
393394 }
394395 if msg .Tier >= uint (* tiersFlag ) {
396+ //lint:ignore ST1005 This error is to be displayed in the browser
395397 if err = sendError (conn , errors .New ("Invalid funding tier requested" )); err != nil {
396398 log .Warn ("Failed to send tier error to client" , "err" , err )
397399 return
@@ -429,6 +431,7 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) {
429431 }
430432 if ! result .Success {
431433 log .Warn ("Captcha verification failed" , "err" , string (result .Errors ))
434+ //lint:ignore ST1005 it's funny and the robot won't mind
432435 if err = sendError (conn , errors .New ("Beep-bop, you're a robot!" )); err != nil {
433436 log .Warn ("Failed to send captcha failure to client" , "err" , err )
434437 return
@@ -450,6 +453,7 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) {
450453 }
451454 continue
452455 case strings .HasPrefix (msg .URL , "https://plus.google.com/" ):
456+ //lint:ignore ST1005 Google is a company name and should be capitalized.
453457 if err = sendError (conn , errors .New ("Google+ authentication discontinued as the service was sunset" )); err != nil {
454458 log .Warn ("Failed to send Google+ deprecation to client" , "err" , err )
455459 return
@@ -462,6 +466,7 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) {
462466 case * noauthFlag :
463467 username , avatar , address , err = authNoAuth (msg .URL )
464468 default :
469+ //lint:ignore ST1005 This error is to be displayed in the browser
465470 err = errors .New ("Something funky happened, please open an issue at https://github.com/ethereum/go-ethereum/issues" )
466471 }
467472 if err != nil {
@@ -520,7 +525,7 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) {
520525
521526 // Send an error if too frequent funding, othewise a success
522527 if ! fund {
523- if err = sendError (conn , fmt .Errorf ("%s left until next allowance" , common .PrettyDuration (timeout . Sub ( time .Now () )))); err != nil { // nolint: gosimple
528+ if err = sendError (conn , fmt .Errorf ("%s left until next allowance" , common .PrettyDuration (time .Until ( timeout )))); err != nil { // nolint: gosimple
524529 log .Warn ("Failed to send funding error to client" , "err" , err )
525530 return
526531 }
@@ -682,6 +687,7 @@ func authTwitter(url string) (string, string, common.Address, error) {
682687 // Ensure the user specified a meaningful URL, no fancy nonsense
683688 parts := strings .Split (url , "/" )
684689 if len (parts ) < 4 || parts [len (parts )- 2 ] != "status" {
690+ //lint:ignore ST1005 This error is to be displayed in the browser
685691 return "" , "" , common.Address {}, errors .New ("Invalid Twitter status URL" )
686692 }
687693 // Twitter's API isn't really friendly with direct links. Still, we don't
@@ -696,6 +702,7 @@ func authTwitter(url string) (string, string, common.Address, error) {
696702 // Resolve the username from the final redirect, no intermediate junk
697703 parts = strings .Split (res .Request .URL .String (), "/" )
698704 if len (parts ) < 4 || parts [len (parts )- 2 ] != "status" {
705+ //lint:ignore ST1005 This error is to be displayed in the browser
699706 return "" , "" , common.Address {}, errors .New ("Invalid Twitter status URL" )
700707 }
701708 username := parts [len (parts )- 3 ]
@@ -706,6 +713,7 @@ func authTwitter(url string) (string, string, common.Address, error) {
706713 }
707714 address := common .HexToAddress (string (regexp .MustCompile ("0x[0-9a-fA-F]{40}" ).Find (body )))
708715 if address == (common.Address {}) {
716+ //lint:ignore ST1005 This error is to be displayed in the browser
709717 return "" , "" , common.Address {}, errors .New ("No Ethereum address found to fund" )
710718 }
711719 var avatar string
@@ -721,6 +729,7 @@ func authFacebook(url string) (string, string, common.Address, error) {
721729 // Ensure the user specified a meaningful URL, no fancy nonsense
722730 parts := strings .Split (url , "/" )
723731 if len (parts ) < 4 || parts [len (parts )- 2 ] != "posts" {
732+ //lint:ignore ST1005 This error is to be displayed in the browser
724733 return "" , "" , common.Address {}, errors .New ("Invalid Facebook post URL" )
725734 }
726735 username := parts [len (parts )- 3 ]
@@ -740,6 +749,7 @@ func authFacebook(url string) (string, string, common.Address, error) {
740749 }
741750 address := common .HexToAddress (string (regexp .MustCompile ("0x[0-9a-fA-F]{40}" ).Find (body )))
742751 if address == (common.Address {}) {
752+ //lint:ignore ST1005 This error is to be displayed in the browser
743753 return "" , "" , common.Address {}, errors .New ("No Ethereum address found to fund" )
744754 }
745755 var avatar string
@@ -755,6 +765,7 @@ func authFacebook(url string) (string, string, common.Address, error) {
755765func authNoAuth (url string ) (string , string , common.Address , error ) {
756766 address := common .HexToAddress (regexp .MustCompile ("0x[0-9a-fA-F]{40}" ).FindString (url ))
757767 if address == (common.Address {}) {
768+ //lint:ignore ST1005 This error is to be displayed in the browser
758769 return "" , "" , common.Address {}, errors .New ("No Ethereum address found to fund" )
759770 }
760771 return address .Hex () + "@noauth" , "" , address , nil
0 commit comments