From c843646773651e7fc713aa716d435456c822c9c0 Mon Sep 17 00:00:00 2001 From: quike Date: Fri, 8 Mar 2024 00:24:55 -0500 Subject: [PATCH 01/10] feat(deps): update go-github to v60 --- .gitignore | 2 +- go.mod | 2 +- go.sum | 4 ++-- src/mock/endpointpattern_test.go | 2 +- src/mock/server_options_external_test.go | 2 +- src/mock/server_options_test.go | 2 +- src/mock/server_test.go | 2 +- src/mock/utils.go | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 66fd13c..839a56d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ *.out # Dependency directories (remove the comment below to include it) -# vendor/ +vendor/ diff --git a/go.mod b/go.mod index 448cec0..a8622e3 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/buger/jsonparser v1.1.1 github.com/go-kit/log v0.2.1 - github.com/google/go-github/v59 v59.0.0 + github.com/google/go-github/v60 v60.0.0 github.com/gorilla/mux v1.8.0 golang.org/x/time v0.3.0 ) diff --git a/go.sum b/go.sum index 9b77250..1e27aae 100644 --- a/go.sum +++ b/go.sum @@ -7,8 +7,8 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v59 v59.0.0 h1:7h6bgpF5as0YQLLkEiVqpgtJqjimMYhBkD4jT5aN3VA= -github.com/google/go-github/v59 v59.0.0/go.mod h1:rJU4R0rQHFVFDOkqGWxfLNo6vEk4dv40oDjhV/gH6wM= +github.com/google/go-github/v60 v60.0.0 h1:oLG98PsLauFvvu4D/YPxq374jhSxFYdzQGNCyONLfn8= +github.com/google/go-github/v60 v60.0.0/go.mod h1:ByhX2dP9XT9o/ll2yXAu2VD8l5eNVg8hD4Cr0S/LmQk= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= diff --git a/src/mock/endpointpattern_test.go b/src/mock/endpointpattern_test.go index 1832ce5..1c13b07 100644 --- a/src/mock/endpointpattern_test.go +++ b/src/mock/endpointpattern_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func TestRepoGetContents(t *testing.T) { diff --git a/src/mock/server_options_external_test.go b/src/mock/server_options_external_test.go index b945491..2a6f325 100644 --- a/src/mock/server_options_external_test.go +++ b/src/mock/server_options_external_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "github.com/migueleliasweb/go-github-mock/src/mock" ) diff --git a/src/mock/server_options_test.go b/src/mock/server_options_test.go index 72ed3d2..d6a979e 100644 --- a/src/mock/server_options_test.go +++ b/src/mock/server_options_test.go @@ -3,7 +3,7 @@ package mock import ( "testing" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "github.com/gorilla/mux" ) diff --git a/src/mock/server_test.go b/src/mock/server_test.go index 7556f60..b7449cc 100644 --- a/src/mock/server_test.go +++ b/src/mock/server_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) func TestNewMockedHTTPClient(t *testing.T) { diff --git a/src/mock/utils.go b/src/mock/utils.go index f0e1750..bab6367 100644 --- a/src/mock/utils.go +++ b/src/mock/utils.go @@ -4,7 +4,7 @@ import ( "encoding/json" "net/http" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) // MustMarshal helper function that wraps json.Marshal From bb82ff23d026ed1249cae0d4f2e0c40c90036321 Mon Sep 17 00:00:00 2001 From: quike Date: Mon, 18 Mar 2024 15:49:58 -0400 Subject: [PATCH 02/10] chore: update endpoint pattern --- Makefile | 3 ++ go.defs | 49 +++++++++++++++++ src/mock/endpointpattern.go | 105 +++++++++++++++++++----------------- 3 files changed, 107 insertions(+), 50 deletions(-) create mode 100644 Makefile create mode 100644 go.defs diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..da0170f --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +COMPONENT := go-github-mock + +include go.defs \ No newline at end of file diff --git a/go.defs b/go.defs new file mode 100644 index 0000000..f772d57 --- /dev/null +++ b/go.defs @@ -0,0 +1,49 @@ +VERSION := 0.0.0 +COVERAGE_DIR := ./target +PACKAGES = ./... +GOPATH := $(shell go env GOPATH) +HOST := github.com +OWNER := migueleliasweb + +init: + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 + +lint: init + $(GOPATH)/bin/golangci-lint run ./... + +generate: + go generate $(PACKAGES) + +format: + go fmt $(PACKAGES) + +clean: + @echo "Cleaning target/" + @rm -rf target + go mod tidy + +test: + go test -coverprofile=$(COVERAGE_DIR)/coverage.out $(PACKAGES) + go tool cover -html=$(COVERAGE_DIR)/coverage.out -o $(COVERAGE_DIR)/coverage.html + +verify: + go mod verify + go vet -all $(PACKAGES) + +compile: + go build $(PACKAGES) + +build-init: + mkdir -p target/builds + +build: clean build-init verify compile test + for GOOS in darwin linux windows; do \ + mkdir -p target/builds/$$GOOS ; \ + GOOS=$$GOOS CGO_ENABLED=0 go build -a -installsuffix cgo \ + -ldflags " \ + -X $(HOST)/$(OWNER)/$(COMPONENT)/cli.CLIVersion=$(VERSION) \ + -X $(HOST)/$(OWNER)/$(COMPONENT)/cli.CLISHA=$(shell git rev-parse --short HEAD) \ + -X $(HOST)/$(OWNER)/$(COMPONENT)/cli.CLIOS=$$GOOS" \ + -v -o target/builds/$$GOOS/$(COMPONENT) ; \ + done + chmod -R 755 target/builds diff --git a/src/mock/endpointpattern.go b/src/mock/endpointpattern.go index ccf8e61..f00136f 100644 --- a/src/mock/endpointpattern.go +++ b/src/mock/endpointpattern.go @@ -2702,6 +2702,56 @@ var DeleteReposEnvironmentsDeploymentProtectionRulesByOwnerByRepoByEnvironmentNa Method: "DELETE", } +var GetReposEnvironmentsSecretsByOwnerByRepoByEnvironmentName EndpointPattern = EndpointPattern{ + Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/secrets", + Method: "GET", +} + +var GetReposEnvironmentsSecretsPublicKeyByOwnerByRepoByEnvironmentName EndpointPattern = EndpointPattern{ + Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key", + Method: "GET", +} + +var GetReposEnvironmentsSecretsByOwnerByRepoByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{ + Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}", + Method: "GET", +} + +var PutReposEnvironmentsSecretsByOwnerByRepoByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{ + Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}", + Method: "PUT", +} + +var DeleteReposEnvironmentsSecretsByOwnerByRepoByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{ + Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}", + Method: "DELETE", +} + +var GetReposEnvironmentsVariablesByOwnerByRepoByEnvironmentName EndpointPattern = EndpointPattern{ + Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/variables", + Method: "GET", +} + +var PostReposEnvironmentsVariablesByOwnerByRepoByEnvironmentName EndpointPattern = EndpointPattern{ + Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/variables", + Method: "POST", +} + +var GetReposEnvironmentsVariablesByOwnerByRepoByEnvironmentNameByName EndpointPattern = EndpointPattern{ + Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}", + Method: "GET", +} + +var PatchReposEnvironmentsVariablesByOwnerByRepoByEnvironmentNameByName EndpointPattern = EndpointPattern{ + Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}", + Method: "PATCH", +} + +var DeleteReposEnvironmentsVariablesByOwnerByRepoByEnvironmentNameByName EndpointPattern = EndpointPattern{ + Pattern: "/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}", + Method: "DELETE", +} + var GetReposEventsByOwnerByRepo EndpointPattern = EndpointPattern{ Pattern: "/repos/{owner}/{repo}/events", Method: "GET", @@ -3232,6 +3282,11 @@ var GetReposPagesHealthByOwnerByRepo EndpointPattern = EndpointPattern{ Method: "GET", } +var GetReposPrivateVulnerabilityReportingByOwnerByRepo EndpointPattern = EndpointPattern{ + Pattern: "/repos/{owner}/{repo}/private-vulnerability-reporting", + Method: "GET", +} + var PutReposPrivateVulnerabilityReportingByOwnerByRepo EndpointPattern = EndpointPattern{ Pattern: "/repos/{owner}/{repo}/private-vulnerability-reporting", Method: "PUT", @@ -3752,56 +3807,6 @@ var GetRepositories EndpointPattern = EndpointPattern{ Method: "GET", } -var GetRepositoriesEnvironmentsSecretsByRepositoryIdByEnvironmentName EndpointPattern = EndpointPattern{ - Pattern: "/repositories/{repository_id}/environments/{environment_name}/secrets", - Method: "GET", -} - -var GetRepositoriesEnvironmentsSecretsPublicKeyByRepositoryIdByEnvironmentName EndpointPattern = EndpointPattern{ - Pattern: "/repositories/{repository_id}/environments/{environment_name}/secrets/public-key", - Method: "GET", -} - -var GetRepositoriesEnvironmentsSecretsByRepositoryIdByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{ - Pattern: "/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", - Method: "GET", -} - -var PutRepositoriesEnvironmentsSecretsByRepositoryIdByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{ - Pattern: "/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", - Method: "PUT", -} - -var DeleteRepositoriesEnvironmentsSecretsByRepositoryIdByEnvironmentNameBySecretName EndpointPattern = EndpointPattern{ - Pattern: "/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", - Method: "DELETE", -} - -var GetRepositoriesEnvironmentsVariablesByRepositoryIdByEnvironmentName EndpointPattern = EndpointPattern{ - Pattern: "/repositories/{repository_id}/environments/{environment_name}/variables", - Method: "GET", -} - -var PostRepositoriesEnvironmentsVariablesByRepositoryIdByEnvironmentName EndpointPattern = EndpointPattern{ - Pattern: "/repositories/{repository_id}/environments/{environment_name}/variables", - Method: "POST", -} - -var GetRepositoriesEnvironmentsVariablesByRepositoryIdByEnvironmentNameByName EndpointPattern = EndpointPattern{ - Pattern: "/repositories/{repository_id}/environments/{environment_name}/variables/{name}", - Method: "GET", -} - -var PatchRepositoriesEnvironmentsVariablesByRepositoryIdByEnvironmentNameByName EndpointPattern = EndpointPattern{ - Pattern: "/repositories/{repository_id}/environments/{environment_name}/variables/{name}", - Method: "PATCH", -} - -var DeleteRepositoriesEnvironmentsVariablesByRepositoryIdByEnvironmentNameByName EndpointPattern = EndpointPattern{ - Pattern: "/repositories/{repository_id}/environments/{environment_name}/variables/{name}", - Method: "DELETE", -} - var GetSearchCode EndpointPattern = EndpointPattern{ Pattern: "/search/code", Method: "GET", From 1004dbd7761d3e606fbe7804f3cf3d5f52036eed Mon Sep 17 00:00:00 2001 From: quike Date: Mon, 18 Mar 2024 15:51:10 -0400 Subject: [PATCH 03/10] chore: add editorconfig --- Makefile | 2 +- src/mock/.editorconfig | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/mock/.editorconfig diff --git a/Makefile b/Makefile index da0170f..dd43365 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ COMPONENT := go-github-mock -include go.defs \ No newline at end of file +include go.defs diff --git a/src/mock/.editorconfig b/src/mock/.editorconfig new file mode 100644 index 0000000..aa8d238 --- /dev/null +++ b/src/mock/.editorconfig @@ -0,0 +1,21 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false + +[{Makefile,**.defs}] +indent_style = tab + +[*.go] +indent_style = tab From cfabf63a2f51cffb1c01cdd2d03e0a69a1adbd96 Mon Sep 17 00:00:00 2001 From: quike Date: Mon, 18 Mar 2024 16:16:12 -0400 Subject: [PATCH 04/10] feat: add github actions --- .github/dependabot.yml | 10 +++++++ .github/workflows/lint.yml | 12 +++++++++ .github/workflows/pr.yml | 53 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/pr.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ec73510 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + - package-ecosystem: gomod + directory: / + schedule: + interval: weekly \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..d3966ca --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,12 @@ +name: pr +on: pull_request +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 1.x + cache-dependency-path: "**/go.sum" + - run: make lint \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..f879cba --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,53 @@ +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: pull_request + +name: tests +env: + GO111MODULE: on + +permissions: + contents: read + +jobs: + build: + defaults: + run: + shell: bash + strategy: + matrix: + go-version: [1.x, 1.21.x] + platform: [ubuntu-latest] + include: + - go-version: 1.x + platform: ubuntu-latest + update-coverage: true + runs-on: ${{ matrix.platform }} + + steps: + - uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + - uses: actions/checkout@v4 + + - id: cache-paths + run: | + echo "go-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT + echo "go-mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT + + - name: Cache go modules + uses: actions/cache@v4 + with: + path: | + ${{ steps.cache-paths.outputs.go-cache }} + ${{ steps.cache-paths.outputs.go-mod-cache }} + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go- + + - name: Test + run: make test + + - name: Build + run: make build \ No newline at end of file From 58142615d2579180454ee0ec200e4bcab81ec9ec Mon Sep 17 00:00:00 2001 From: quike Date: Mon, 18 Mar 2024 16:18:14 -0400 Subject: [PATCH 05/10] fix: correct insert final new line --- .github/dependabot.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/pr.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ec73510..632e8eb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,4 +7,4 @@ updates: - package-ecosystem: gomod directory: / schedule: - interval: weekly \ No newline at end of file + interval: weekly diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d3966ca..4e3fd42 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,4 +9,4 @@ jobs: with: go-version: 1.x cache-dependency-path: "**/go.sum" - - run: make lint \ No newline at end of file + - run: make lint diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f879cba..bb1547e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -50,4 +50,4 @@ jobs: run: make test - name: Build - run: make build \ No newline at end of file + run: make build From d70891361a6739dd0415c085f4e768fa1ca03294 Mon Sep 17 00:00:00 2001 From: quike Date: Mon, 18 Mar 2024 16:18:41 -0400 Subject: [PATCH 06/10] fix: move editorconfig file --- src/mock/.editorconfig => .editorconfig | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/mock/.editorconfig => .editorconfig (100%) diff --git a/src/mock/.editorconfig b/.editorconfig similarity index 100% rename from src/mock/.editorconfig rename to .editorconfig From d45ee7ef8c7109caf2c7f7a72bcc80dc40aa0853 Mon Sep 17 00:00:00 2001 From: quike Date: Mon, 18 Mar 2024 16:21:06 -0400 Subject: [PATCH 07/10] fix: correct jobs names --- .github/workflows/lint.yml | 2 +- .github/workflows/pr.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4e3fd42..952f3ba 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: pr +name: lint on: pull_request jobs: lint: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bb1547e..3825d04 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -2,9 +2,10 @@ concurrency: group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +name: pr + on: pull_request -name: tests env: GO111MODULE: on From be9c8ca70bef2fa2df880df8b97e1e1a45730d8b Mon Sep 17 00:00:00 2001 From: quike Date: Mon, 18 Mar 2024 16:26:47 -0400 Subject: [PATCH 08/10] fix: use build instead of test step --- .github/workflows/pr.yml | 3 --- go.defs | 12 ++++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3825d04..59a4465 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -47,8 +47,5 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-go- - - name: Test - run: make test - - name: Build run: make build diff --git a/go.defs b/go.defs index f772d57..413c3af 100644 --- a/go.defs +++ b/go.defs @@ -1,9 +1,9 @@ -VERSION := 0.0.0 -COVERAGE_DIR := ./target -PACKAGES = ./... -GOPATH := $(shell go env GOPATH) -HOST := github.com -OWNER := migueleliasweb +VERSION := 0.0.0 +COVERAGE_DIR := ./target +PACKAGES = ./... +GOPATH := $(shell go env GOPATH) +HOST := github.com +OWNER := migueleliasweb init: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 From de9aef0da521791b1272de20f4cb3802951a8c99 Mon Sep 17 00:00:00 2001 From: quike Date: Mon, 18 Mar 2024 16:33:42 -0400 Subject: [PATCH 09/10] fix: reorg workflows --- .github/workflows/lint.yml | 12 ++++++++++++ .github/workflows/pr.yml | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 952f3ba..33ae759 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,5 +1,17 @@ name: lint + on: pull_request + +env: + GO111MODULE: on + +permissions: + contents: read + +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: lint: runs-on: ubuntu-latest diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 59a4465..ce74136 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,7 +1,3 @@ -concurrency: - group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - name: pr on: pull_request @@ -12,6 +8,10 @@ env: permissions: contents: read +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: defaults: From f257a1ff424660920d01854d09706c20ce728c1b Mon Sep 17 00:00:00 2001 From: quike Date: Mon, 8 Apr 2024 23:19:32 -0400 Subject: [PATCH 10/10] chore(deps): upgrade golangci-lint --- .gitignore | 3 ++- .golangci.yml | 0 go.defs | 2 +- main.go | 3 +-- 4 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 .golangci.yml diff --git a/.gitignore b/.gitignore index c07171e..0d2c7b7 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ # Dependency directories (remove the comment below to include it) vendor/ coverage.txt -go-github-mock \ No newline at end of file +go-github-mock +target/ diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..e69de29 diff --git a/go.defs b/go.defs index 22dadcf..2b697eb 100644 --- a/go.defs +++ b/go.defs @@ -6,7 +6,7 @@ HOST := github.com OWNER := migueleliasweb init: - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.2 + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2 lint: init $(GOPATH)/bin/golangci-lint run ./... diff --git a/main.go b/main.go index 0304ca1..cd642c3 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,6 @@ import ( "bytes" "flag" "fmt" - "io/ioutil" "os" "os/exec" @@ -74,7 +73,7 @@ func main() { "paths", ) - ioutil.WriteFile( + os.WriteFile( gen.OUTPUT_FILEPATH, buf.Bytes(), 0755,