diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3671f3..3b4c342 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,7 +39,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: 1.21 - name: Run Test run: | diff --git a/.golangci.yml b/.golangci.yml index 6861b64..9afef92 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,6 +6,9 @@ linters-settings: settings: mnd: ignored-numbers: "0o666,0o777" + funlen: + lines: 77 + statements: 50 linters: enable-all: true disable: diff --git a/go.mod b/go.mod index 130d544..f1e1440 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/android-project-46group/core-api -go 1.19 +go 1.21 require ( github.com/DATA-DOG/go-sqlmock v1.5.0 diff --git a/repository/database/member.go b/repository/database/member.go index ac9ad4c..5d6afac 100644 --- a/repository/database/member.go +++ b/repository/database/member.go @@ -43,6 +43,7 @@ func (d *database) ListMembers(ctx context.Context) ([]*model.Member, error) { if err != nil { return nil, fmt.Errorf("failed to conn.Querytext: %w", err) } + defer func() { if err := rows.Close(); err != nil { d.logger.Warnf(ctx, "failed to rows.Close: ", err) diff --git a/util/logger/file_logger.go b/util/logger/file_logger.go index c53cc5f..34ec37e 100644 --- a/util/logger/file_logger.go +++ b/util/logger/file_logger.go @@ -41,6 +41,7 @@ func NewFileLogger( } return logger, func() error { + //nolint:wrapcheck return logfile.Close() }, nil }