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

a few more golint fixes #22

Merged
merged 1 commit into from
Apr 15, 2020
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
11 changes: 5 additions & 6 deletions graphql/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ var IncludeDirective = schema.IncludeDirective
// SkipDirective implements the @skip directive as defined by the GraphQL spec.
var SkipDirective = schema.SkipDirective

// IDType implements the ID type as defined by the GraphQL spec.
// IDType implements the ID type as defined by the GraphQL spec. It can be deserialized from a
// string or an integer type, but always serializes to a string.
var IDType = schema.IDType

// StringType implements the String type as defined by the GraphQL spec.
var StringType = schema.StringType

// IDType implements the ID type as defined by the GraphQL spec. It can be deserialized from a
// string or an integer type, but always serializes to a string.
// IntType implements the Int type as defined by the GraphQL spec.
var IntType = schema.IntType

// FloatType implements the Float type as defined by the GraphQL spec.
Expand Down Expand Up @@ -155,10 +155,9 @@ func NewRequestFromHTTP(r *http.Request) (req *Request, code int, err error) {

switch r.Method {
case http.MethodGet:
if query := r.URL.Query().Get("query"); query == "" {
req.Query = r.URL.Query().Get("query")
if req.Query == "" {
return nil, http.StatusBadRequest, fmt.Errorf("the query parameter is required")
} else {
req.Query = query
}

if variables := r.URL.Query().Get("variables"); variables != "" {
Expand Down
14 changes: 7 additions & 7 deletions subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ func (s *SubscriptionSourceStream) Run(ctx context.Context, onEvent func(interfa
},
}
for {
if chosen, recv, recvOK := reflect.Select(selectCases); chosen == 0 {
chosen, recv, recvOK := reflect.Select(selectCases)
if chosen == 0 {
// ctx.Done()
return ctx.Err()
}
// s.EventChannel
if recvOK {
onEvent(recv.Interface())
} else {
// s.EventChannel
if recvOK {
onEvent(recv.Interface())
} else {
return nil
}
return nil
}
}
}