Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linter: fix punctuation and capitalization #2021

Merged
merged 1 commit into from
Dec 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/control_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (l *localControlRouter) Handle(_ context.Context, probeID string, req xfer.
probe, ok := l.probes[probeID]
l.Unlock()
if !ok {
return xfer.Response{}, fmt.Errorf("Probe %s is not connected right now...", probeID)
return xfer.Response{}, fmt.Errorf("probe %s is not connected right now", probeID)
}
return probe.handler(req), nil
}
Expand Down
4 changes: 2 additions & 2 deletions app/multitenant/consul_pipe_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ func (pr *consulPipeRouter) Release(ctx context.Context, id string, e app.End) e
// atomically clear my end of the pipe in consul
return pr.client.CAS(key, &consulPipe{}, func(in interface{}) (interface{}, bool, error) {
if in == nil {
return nil, false, fmt.Errorf("Pipe %s not found", id)
return nil, false, fmt.Errorf("pipe %s not found", id)
}
p := in.(*consulPipe)
if p.addrFor(e) != pr.advertise {
return nil, false, fmt.Errorf("Pipe %s not owned by us!", id)
return nil, false, fmt.Errorf("pipe %s not owned by us", id)
}
refs := p.release(e)
if refs == 0 {
Expand Down
4 changes: 2 additions & 2 deletions app/multitenant/sqs_control_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (cr *sqsControlRouter) Handle(ctx context.Context, probeID string, req xfer
// Get the queue url for the local (control app) queue, and for the probe.
responseQueueURL := cr.getResponseQueueURL()
if responseQueueURL == nil {
return xfer.Response{}, fmt.Errorf("No SQS queue yet!")
return xfer.Response{}, fmt.Errorf("no SQS queue yet")
}

var probeQueueURL *sqs.GetQueueUrlOutput
Expand Down Expand Up @@ -258,7 +258,7 @@ func (cr *sqsControlRouter) Handle(ctx context.Context, probeID string, req xfer
case response := <-waiter:
return response, nil
case <-time.After(rpcTimeout):
return xfer.Response{}, fmt.Errorf("Request timedout.")
return xfer.Response{}, fmt.Errorf("request timed out")
}
}

Expand Down
20 changes: 10 additions & 10 deletions test/fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (p dir) ReadDirNames(path string) ([]string, error) {

func (p dir) ReadFile(path string) ([]byte, error) {
if path == "/" {
return nil, fmt.Errorf("I'm a directory!")
return nil, fmt.Errorf("I'm a directory")
}

head, tail := split(path)
Expand Down Expand Up @@ -158,7 +158,7 @@ func (p dir) Stat(path string, stat *syscall.Stat_t) error {

func (p dir) Open(path string) (io.ReadWriteCloser, error) {
if path == "/" {
return nil, fmt.Errorf("I'm a directory!")
return nil, fmt.Errorf("I'm a directory")
}

head, tail := split(path)
Expand Down Expand Up @@ -208,18 +208,18 @@ func (p File) IsDir() bool { return false }

// ReadDir implements FS
func (p File) ReadDir(path string) ([]os.FileInfo, error) {
return nil, fmt.Errorf("I'm a file!")
return nil, fmt.Errorf("I'm a file")
}

// ReadDirNames implements FS
func (p File) ReadDirNames(path string) ([]string, error) {
return nil, fmt.Errorf("I'm a file!")
return nil, fmt.Errorf("I'm a file")
}

// ReadFile implements FS
func (p File) ReadFile(path string) ([]byte, error) {
if path != "/" {
return nil, fmt.Errorf("I'm a file!")
return nil, fmt.Errorf("I'm a file")
}
if p.FReader != nil {
return ioutil.ReadAll(p.FReader)
Expand All @@ -230,7 +230,7 @@ func (p File) ReadFile(path string) ([]byte, error) {
// Lstat implements FS
func (p File) Lstat(path string, stat *syscall.Stat_t) error {
if path != "/" {
return fmt.Errorf("I'm a file!")
return fmt.Errorf("I'm a file")
}
*stat = p.FStat
return nil
Expand All @@ -239,7 +239,7 @@ func (p File) Lstat(path string, stat *syscall.Stat_t) error {
// Stat implements FS
func (p File) Stat(path string, stat *syscall.Stat_t) error {
if path != "/" {
return fmt.Errorf("I'm a file!")
return fmt.Errorf("I'm a file")
}
*stat = p.FStat
return nil
Expand All @@ -248,7 +248,7 @@ func (p File) Stat(path string, stat *syscall.Stat_t) error {
// Open implements FS
func (p File) Open(path string) (io.ReadWriteCloser, error) {
if path != "/" {
return nil, fmt.Errorf("I'm a file!")
return nil, fmt.Errorf("I'm a file")
}
buf := bytes.NewBuffer([]byte(p.FContents))
s := struct {
Expand All @@ -273,15 +273,15 @@ func (p File) Open(path string) (io.ReadWriteCloser, error) {
// Add adds a new node to the fs
func (p File) Add(path string, e Entry) error {
if path != "/" {
return fmt.Errorf("I'm a file!")
return fmt.Errorf("I'm a file")
}
return nil
}

// Remove removes a node from the fs
func (p File) Remove(path string) error {
if path != "/" {
return fmt.Errorf("I'm a file!")
return fmt.Errorf("I'm a file")
}
return nil
}
14 changes: 7 additions & 7 deletions tools/cmd/wcloud/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (c Client) Deploy(deployment Deployment) error {
return err
}
if res.StatusCode != 204 {
return fmt.Errorf("Error making request: %s", res.Status)
return fmt.Errorf("error making request: %s", res.Status)
}
return nil
}
Expand All @@ -63,7 +63,7 @@ func (c Client) GetDeployments(from, through int64) ([]Deployment, error) {
return nil, err
}
if res.StatusCode != 200 {
return nil, fmt.Errorf("Error making request: %s", res.Status)
return nil, fmt.Errorf("error making request: %s", res.Status)
}
var response struct {
Deployments []Deployment `json:"deployments"`
Expand All @@ -85,7 +85,7 @@ func (c Client) GetEvents(from, through int64) ([]byte, error) {
return nil, err
}
if res.StatusCode != 200 {
return nil, fmt.Errorf("Error making request: %s", res.Status)
return nil, fmt.Errorf("error making request: %s", res.Status)
}
return ioutil.ReadAll(res.Body)
}
Expand All @@ -101,10 +101,10 @@ func (c Client) GetConfig() (*Config, error) {
return nil, err
}
if res.StatusCode == 404 {
return nil, fmt.Errorf("No configuration uploaded yet.")
return nil, fmt.Errorf("no configuration uploaded yet")
}
if res.StatusCode != 200 {
return nil, fmt.Errorf("Error making request: %s", res.Status)
return nil, fmt.Errorf("error making request: %s", res.Status)
}
var config Config
if err := json.NewDecoder(res.Body).Decode(&config); err != nil {
Expand All @@ -128,7 +128,7 @@ func (c Client) SetConfig(config *Config) error {
return err
}
if res.StatusCode != 204 {
return fmt.Errorf("Error making request: %s", res.Status)
return fmt.Errorf("error making request: %s", res.Status)
}
return nil
}
Expand All @@ -144,7 +144,7 @@ func (c Client) GetLogs(deployID string) ([]byte, error) {
return nil, err
}
if res.StatusCode != 200 {
return nil, fmt.Errorf("Error making request: %s", res.Status)
return nil, fmt.Errorf("error making request: %s", res.Status)
}
return ioutil.ReadAll(res.Body)
}