这是indexloc提供的服务,不要输入任何密码
Skip to content

Fix some linting errors #179

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

Merged
merged 1 commit into from
May 1, 2024
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 Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ tasks:
- install-providerlint
cmds:
- staticcheck -tags it ./...
- tfproviderlint -R018=false -R009=false ./...
- tfproviderlint -R018=false ./...
- cmd: |
export BADFMT=$(gofmt -s -l .)
test -z "$BADFMT" || (echo -e "invalid gofmt: $BADFMT"; exit 1)
Expand Down
6 changes: 5 additions & 1 deletion client/must_marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func (v *VercelAuthentication) MarshalJSON() ([]byte, error) {
// be marshaled. As our structs are known ahead of time and are all safe to marshal,
// this simplifies the error checking process.
func mustMarshal(v interface{}) []byte {
res, _ := json.Marshal(v)
res, err := json.Marshal(v)
if err != nil {
//lintignore:R009 // this is okay as we know the shape of the data
panic(err)
}
return res
}
2 changes: 0 additions & 2 deletions client/project_protection_bypass_for_automation_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package client
import (
"context"
"fmt"
"time"

"github.com/hashicorp/terraform-plugin-log/tflog"
)
Expand Down Expand Up @@ -50,7 +49,6 @@ func (c *Client) UpdateProtectionBypassForAutomation(ctx context.Context, reques
response := struct {
ProtectionBypass map[string]ProtectionBypass `json:"protectionBypass"`
}{}
time.Sleep(1 * time.Second)
err = c.doRequest(clientRequest{
ctx: ctx,
method: "PATCH",
Expand Down
6 changes: 6 additions & 0 deletions sweep/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,35 @@ func main() {
c := client.New(os.Getenv("VERCEL_API_TOKEN"))
teamID := os.Getenv("VERCEL_TERRAFORM_TESTING_TEAM")
if teamID == "" {
//lintignore:R009
panic("VERCEL_TERRAFORM_TESTING_TEAM environment variable not set")
}
domain := os.Getenv("VERCEL_TERRAFORM_TESTING_DOMAIN")
if domain == "" {
//lintignore:R009
panic("VERCEL_TERRAFORM_TESTING_DOMAIN environment variable not set")
}
ctx := context.Background()

// delete both for the testing team, and for without a team
err := deleteAllProjects(ctx, c, teamID)
if err != nil {
//lintignore:R009
panic(err)
}
err = deleteAllDNSRecords(ctx, c, domain, teamID)
if err != nil {
//lintignore:R009
panic(err)
}
err = deleteAllSharedEnvironmentVariables(ctx, c, teamID)
if err != nil {
//lintignore:R009
panic(err)
}
err = deleteAllEdgeConfigs(ctx, c, teamID)
if err != nil {
//lintignore:R009
panic(err)
}
}
Expand Down