-
Notifications
You must be signed in to change notification settings - Fork 6
go 1.24.3 + deprecation fixes + minor tooling updates #68
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
Changes from all commits
13f48f3
5b5dd2a
c809888
e16ee14
6e27f20
1573b9b
5dae7e5
2b89914
8f0390a
c83cd65
e9aa6f4
d966973
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1.24.3 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # https://golangci-lint.run/usage/configuration/ | ||
| version: '2' | ||
| linters: | ||
| default: standard | ||
| disable: | ||
| - errcheck | ||
| - unused | ||
| formatters: | ||
| enable: | ||
| - gofmt | ||
| - goimports | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| brew 'go' | ||
| brew 'hub' | ||
| brew 'gh' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ package fakeserver | |
| import ( | ||
| "encoding/json" | ||
| "fmt" | ||
| "io/ioutil" | ||
| "io" | ||
| "net/http" | ||
| "strings" | ||
|
|
||
|
|
@@ -341,7 +341,7 @@ func postV1AssignmentOverride(r *http.Request) error { | |
| Variant: r.PostForm.Get("variant"), | ||
| } | ||
| case strings.HasPrefix(contentType, "application/json"): | ||
| requestBytes, err := ioutil.ReadAll(r.Body) | ||
| requestBytes, err := io.ReadAll(r.Body) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
@@ -353,6 +353,10 @@ func postV1AssignmentOverride(r *http.Request) error { | |
| return fmt.Errorf("got unexpected content type %s", contentType) | ||
| } | ||
| assignments, err := fakeassignments.Read() | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
Comment on lines
+356
to
+358
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catches, these. |
||
|
|
||
| (*assignments)[assignment.SplitName] = assignment.Variant | ||
| err = fakeassignments.Write(assignments) | ||
| if err != nil { | ||
|
|
@@ -366,7 +370,7 @@ func postV2AssignmentOverride(r *http.Request) error { | |
| contentType := r.Header.Get("content-type") | ||
| switch { | ||
| case strings.HasPrefix(contentType, "application/json"): | ||
| requestBytes, err := ioutil.ReadAll(r.Body) | ||
| requestBytes, err := io.ReadAll(r.Body) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
@@ -380,6 +384,10 @@ func postV2AssignmentOverride(r *http.Request) error { | |
| return fmt.Errorf("got unexpected content type %s", contentType) | ||
| } | ||
| storedAssignments, err := fakeassignments.Read() | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| for _, assignment := range assignments { | ||
| (*storedAssignments)[assignment.SplitName] = assignment.Variant | ||
| } | ||
|
|
@@ -453,12 +461,12 @@ func getV1SplitDetail() (interface{}, error) { | |
| Location: "location", | ||
| Platform: "platform", | ||
| VariantDetails: []v1VariantDetail{ | ||
| v1VariantDetail{ | ||
| { | ||
| Name: "variant_a", | ||
| Description: "this is a fake description", | ||
| ScreenshotURL: "https://example.org/a", | ||
| }, | ||
| v1VariantDetail{ | ||
| { | ||
| Name: "variant_b", | ||
| Description: "this is another fake description", | ||
| ScreenshotURL: "https://example.org/b", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,7 +114,7 @@ func (f *FeatureCompletion) ApplyToSchema(schema *serializers.Schema, _ migratio | |
| if idempotently { | ||
| return nil | ||
| } | ||
| return fmt.Errorf("Couldn't locate feature_completion of %s in schema", *f.featureGate) | ||
| return fmt.Errorf("couldn't locate feature_completion of %s in schema", *f.featureGate) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not? Should we be using something other than an inline string if we want to return a capital "C" to the end user?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is sort of a go idiom, https://google.github.io/styleguide/go/decisions.html#error-strings If we do want to return a capital C we can ignore the linting rule
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's fine -- generally happy to stick with community conventions in 99.9% of cases. |
||
| } | ||
| for i, candidate := range schema.FeatureCompletions { // Replace | ||
| if candidate.FeatureGate == *f.featureGate { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| module github.com/Betterment/testtrack-cli | ||
|
|
||
| go 1.17 | ||
| go 1.24 | ||
|
|
||
| require ( | ||
| github.com/gorilla/mux v1.7.1 | ||
| github.com/joho/godotenv v1.3.0 | ||
| github.com/pkg/errors v0.8.1 | ||
| github.com/rs/cors v1.6.0 | ||
| github.com/spf13/cobra v0.0.3 | ||
| github.com/stretchr/testify v1.3.0 | ||
| gopkg.in/yaml.v2 v2.2.4 | ||
| github.com/gorilla/mux v1.8.1 | ||
| github.com/joho/godotenv v1.5.1 | ||
| github.com/rs/cors v1.11.1 | ||
| github.com/spf13/cobra v1.9.1 | ||
| github.com/stretchr/testify v1.10.0 | ||
| gopkg.in/yaml.v2 v2.4.0 | ||
| ) | ||
|
|
||
| require ( | ||
| github.com/davecgh/go-spew v1.1.1 // indirect | ||
| github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
| github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
| github.com/pmezard/go-difflib v1.0.0 // indirect | ||
| github.com/spf13/pflag v1.0.3 // indirect | ||
| github.com/spf13/pflag v1.0.6 // indirect | ||
| gopkg.in/yaml.v3 v3.0.1 // indirect | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you intend to circle back and enable either of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I wanted to avoid adding any more changes to this PR.