Skip to content

Commit e04b5ea

Browse files
author
heraclmene
committed
Go report card fixes
1 parent 9be9972 commit e04b5ea

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

api_service.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (a seleniumAPIService) performRequest(url string, method string, body io.Re
3838
client := http.Client{}
3939
resp, err := client.Do(request)
4040
if err != nil {
41-
return nil, errors.New(fmt.Sprintf("%s: an unexpected communication failure occurred, error: %s", method, err.Error()))
41+
return nil, fmt.Errorf("%s: an unexpected communication failure occurred, error: %s", method, err.Error())
4242
}
4343

4444
defer resp.Body.Close()
@@ -54,10 +54,10 @@ func (a seleniumAPIService) performRequest(url string, method string, body io.Re
5454
err := json.Unmarshal(r, &reqErr)
5555
if err == nil {
5656
return nil, &reqErr
57-
} else {
58-
errStr = fmt.Sprintf("Status code %v returned with no body", resp.StatusCode)
59-
return nil, errors.New(errStr)
6057
}
58+
59+
errStr = fmt.Sprintf("Status code %v returned with no body", resp.StatusCode)
60+
return nil, errors.New(errStr)
6161
}
6262

6363
return r, nil

doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// A Selenium web driver library written in Go.
1+
// Package goselenium is a Selenium web driver library written in Go.
22
package goselenium

errors.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package goselenium
22

3-
import (
4-
"errors"
5-
"fmt"
6-
)
3+
import "fmt"
74

85
// ErrorResponse is what is returned from the Selenium API when an error
96
// occurs.
@@ -145,6 +142,3 @@ func IsInvalidURLError(err error) bool {
145142
func newInvalidURLError(url string) InvalidURLError {
146143
return InvalidURLError(url)
147144
}
148-
149-
// WaitTimeoutError is returned when a Wait call has timed out.
150-
var WaitTimeoutError error = errors.New("wait action timed out")

remote_driver_command.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type WindowHandleResponse struct {
1919
// As per the W3C specification, it yields all of the available window handles
2020
// minus the active one that closes as a result of the CloseWindow() call.
2121
type CloseWindowResponse struct {
22-
State string `json:state"`
22+
State string `json:"state"`
2323
Handles []string `json:"value"`
2424
}
2525

@@ -31,7 +31,7 @@ type SwitchToWindowResponse struct {
3131

3232
// WindowHandlesResponse is the response returned from the WindowHandles()
3333
// method. This is essentially an array of available window handlers that
34-
// aren't neccessarily active.
34+
// aren't necessarily active.
3535
type WindowHandlesResponse struct {
3636
State string `json:"state"`
3737
Handles []string `json:"value"`

0 commit comments

Comments
 (0)