Skip to content

Commit

Permalink
go: linting fixes (#242)
Browse files Browse the repository at this point in the history
* run gofmt with -s

* fix spelling mistakes
  • Loading branch information
mastercactapus authored Dec 2, 2019
1 parent 50bf15b commit 27702a0
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion auth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (h *Handler) ServeProviders(w http.ResponseWriter, req *http.Request) {

// IdentityProviderHandler will return a handler for the given provider ID.
//
// It panics if the id has not been registerd with AddIdentityProvider.
// It panics if the id has not been registered with AddIdentityProvider.
func (h *Handler) IdentityProviderHandler(id string) http.HandlerFunc {
p, ok := h.providers[id]
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion devtools/ci/tasks/scripts/codecheck.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
set -e

NOFMT=$(gofmt -l $(find . -name '*.go' |grep -v /vendor))
NOFMT=$(gofmt -s -l $(find . -name '*.go' |grep -v /vendor))

if test "$NOFMT" != ""
then
Expand Down
2 changes: 1 addition & 1 deletion devtools/mockslack/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type channelState struct {
}

// SetAutoCreateChannel, if set to true, will cause messages sent to
// non-existant channels to succeed by creating the channel automatically.
// non-existent channels to succeed by creating the channel automatically.
func (st *state) SetAutoCreateChannel(value bool) {
st.mx.Lock()
defer st.mx.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion devtools/runjson/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/pkg/errors"
)

// A Task is an independant unit of work
// A Task is an independent unit of work
type Task struct {
// Name is used to identify the task in the case of errors, as well as the prefix for logs.
Name string
Expand Down
6 changes: 3 additions & 3 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ func NewEngine(ctx context.Context, db *sql.DB, c *Config) (*Engine, error) {
p.msg, err = message.NewDB(ctx, db, &message.Config{
MaxMessagesPerCycle: c.MaxMessages,
RateLimit: map[notification.DestType]*message.RateConfig{
notification.DestTypeSMS: &message.RateConfig{PerSecond: 1, Batch: 5 * time.Second},
notification.DestTypeVoice: &message.RateConfig{PerSecond: 1, Batch: 5 * time.Second},
notification.DestTypeSlackChannel: &message.RateConfig{PerSecond: 5, Batch: 5 * time.Second},
notification.DestTypeSMS: {PerSecond: 1, Batch: 5 * time.Second},
notification.DestTypeVoice: {PerSecond: 1, Batch: 5 * time.Second},
notification.DestTypeSlackChannel: {PerSecond: 5, Batch: 5 * time.Second},
},
Pausable: p.mgr,
})
Expand Down
4 changes: 2 additions & 2 deletions engine/message/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ type Config struct {
func DefaultConfig() *Config {
return &Config{
RateLimit: map[notification.DestType]*RateConfig{
notification.DestTypeSMS: &RateConfig{
notification.DestTypeSMS: {
PerSecond: 1,
Batch: 5 * time.Second,
},
notification.DestTypeVoice: &RateConfig{
notification.DestTypeVoice: {
PerSecond: 1,
Batch: 5 * time.Second,
},
Expand Down
2 changes: 1 addition & 1 deletion engine/message/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (q *queue) servicePriority(serviceA, serviceB string) (isLess, ok bool) {
sentB := q.serviceSent[serviceB]

if sentA.Equal(sentB) {
// neither has recieved a message
// neither has received a message
return false, false
}

Expand Down
12 changes: 6 additions & 6 deletions oncall/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,19 @@ func BenchmarkState_CalculateShifts(b *testing.B) {
},
},
overrides: []override.UserOverride{
override.UserOverride{
{
AddUserID: "binbaz",
RemoveUserID: "foobar",
Start: time.Date(2018, 1, 1, 8, 30, 0, 0, time.UTC),
End: time.Date(2018, 1, 1, 8, 45, 0, 0, time.UTC),
},
override.UserOverride{
{
AddUserID: "binbaz2",
RemoveUserID: "foobar",
Start: time.Date(2018, 1, 1, 8, 30, 0, 0, time.UTC),
End: time.Date(2018, 1, 1, 8, 45, 0, 0, time.UTC),
},
override.UserOverride{
{
AddUserID: "binbaz",
RemoveUserID: "foob3ar",
Start: time.Date(2018, 1, 1, 8, 30, 0, 0, time.UTC),
Expand Down Expand Up @@ -287,7 +287,7 @@ func TestState_CalculateShifts(t *testing.T) {
}},
},
overrides: []override.UserOverride{
override.UserOverride{
{
AddUserID: "binbaz",
RemoveUserID: "foobar",
Start: time.Date(2018, 1, 1, 8, 30, 0, 0, time.UTC),
Expand Down Expand Up @@ -331,7 +331,7 @@ func TestState_CalculateShifts(t *testing.T) {
}},
},
overrides: []override.UserOverride{
override.UserOverride{
{
AddUserID: "binbaz",
Start: time.Date(2018, 1, 1, 8, 30, 0, 0, time.UTC),
End: time.Date(2018, 1, 1, 8, 45, 0, 0, time.UTC),
Expand Down Expand Up @@ -368,7 +368,7 @@ func TestState_CalculateShifts(t *testing.T) {
}},
},
overrides: []override.UserOverride{
override.UserOverride{
{
RemoveUserID: "foobar",
Start: time.Date(2018, 1, 1, 8, 30, 0, 0, time.UTC),
End: time.Date(2018, 1, 1, 8, 45, 0, 0, time.UTC),
Expand Down

0 comments on commit 27702a0

Please sign in to comment.