mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
chore: update golang (to 1.20.x) and golangci-linter (#1388)
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
committed by
GitHub
parent
9cc990d7ca
commit
635d07ae04
@@ -30,7 +30,7 @@ func TestHandlers(t *testing.T) {
|
||||
mockrepoDB := mocks.RepoDBMock{}
|
||||
|
||||
Convey("No repo in request", t, func() {
|
||||
request := httptest.NewRequest("GET", UserprefsBaseURL+"", strings.NewReader("My string"))
|
||||
request := httptest.NewRequest(http.MethodGet, UserprefsBaseURL+"", strings.NewReader("My string"))
|
||||
response := httptest.NewRecorder()
|
||||
|
||||
extensions.PutStar(response, request, mockrepoDB, log)
|
||||
@@ -45,7 +45,7 @@ func TestHandlers(t *testing.T) {
|
||||
})
|
||||
|
||||
Convey("Empty repo in request", t, func() {
|
||||
request := httptest.NewRequest("GET", UserprefsBaseURL+"?repo=", strings.NewReader("My string"))
|
||||
request := httptest.NewRequest(http.MethodGet, UserprefsBaseURL+"?repo=", strings.NewReader("My string"))
|
||||
response := httptest.NewRecorder()
|
||||
|
||||
extensions.PutStar(response, request, mockrepoDB, log)
|
||||
@@ -60,7 +60,7 @@ func TestHandlers(t *testing.T) {
|
||||
})
|
||||
|
||||
Convey("ToggleStarRepo different errors", t, func() {
|
||||
request := httptest.NewRequest("GET", UserprefsBaseURL+"?repo=test",
|
||||
request := httptest.NewRequest(http.MethodGet, UserprefsBaseURL+"?repo=test",
|
||||
strings.NewReader("My string"))
|
||||
|
||||
Convey("ErrRepoMetaNotFound", func() {
|
||||
|
||||
@@ -111,7 +111,8 @@ func generateTestData(dbDir string) error { //nolint: gocyclo
|
||||
return err
|
||||
}
|
||||
|
||||
if err = os.WriteFile(path.Join(dbDir, "zot-nonreadable-test", "index.json"), buf, 0o111); err != nil {
|
||||
if err = os.WriteFile(path.Join(dbDir, "zot-nonreadable-test", "index.json"), //nolint:gosec // test code
|
||||
buf, 0o111); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@ import (
|
||||
"zotregistry.io/zot/pkg/meta/repodb"
|
||||
localCtx "zotregistry.io/zot/pkg/requestcontext"
|
||||
"zotregistry.io/zot/pkg/storage"
|
||||
) // THIS CODE IS A STARTING POINT ONLY. IT WILL NOT BE UPDATED WITH SCHEMA CHANGES.
|
||||
)
|
||||
|
||||
// THIS CODE IS A STARTING POINT ONLY. IT WILL NOT BE UPDATED WITH SCHEMA CHANGES.
|
||||
|
||||
const (
|
||||
querySizeLimit = 256
|
||||
|
||||
Reference in New Issue
Block a user