Skip to content
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

Go 1.22 -> 1.23 업데이트합니다. #99

Merged
merged 2 commits into from
Nov 26, 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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
cache: false

- name: Generate Swagger
Expand Down
75 changes: 22 additions & 53 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,6 @@ linters-settings:
# Default: false
extra-rules: true

gomnd:
# List of function patterns to exclude from analysis.
# Values always ignored: `time.Date`,
# `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`,
# `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`.
# Default: []
ignored-functions:
- make
- os.Chmod
- os.Mkdir
- os.MkdirAll
- os.OpenFile
- os.WriteFile
- prometheus.ExponentialBuckets
- prometheus.ExponentialBucketsRange
- prometheus.LinearBuckets
ignored-numbers:
- "2"
- "3"

gomodguard:
blocked:
# List of blocked modules.
Expand All @@ -130,7 +110,7 @@ linters-settings:
# Run `go tool vet help` to see all analyzers.
# Default: []
disable:
- fieldalignment # too strict
- fieldalignment # too strict
# Settings per analyzer.
settings:
shadow:
Expand Down Expand Up @@ -160,7 +140,7 @@ linters-settings:
nolintlint:
# Exclude following linters from requiring an explanation.
# Default: []
allow-no-explanation: [ funlen, gocognit, lll ]
allow-no-explanation: [funlen, gocognit, lll]
# Enable to require an explanation of nonzero length after each nolint directive.
# Default: false
require-explanation: false
Expand All @@ -171,7 +151,6 @@ linters-settings:
revive:
# https://golangci-lint.run/usage/linters/#revive
rules:

# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#add-constant
- name: add-constant
disabled: true
Expand All @@ -183,14 +162,14 @@ linters-settings:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#argument-limit
- name: argument-limit
disabled: false
arguments: [ 7 ]
arguments: [7]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#atomic
- name: atomic
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#banned-characters
- name: banned-characters
disabled: true
arguments: [ "Ω", "Σ", "σ", "7" ]
arguments: ["Ω", "Σ", "σ", "7"]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bare-return
- name: bare-return
disabled: false
Expand All @@ -206,7 +185,7 @@ linters-settings:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#cognitive-complexity
- name: cognitive-complexity
disabled: true
arguments: [ 7 ]
arguments: [7]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#comment-spacings
- name: comment-spacings
disabled: true
Expand All @@ -233,7 +212,7 @@ linters-settings:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#cyclomatic
- name: cyclomatic
disabled: true
arguments: [ 3 ]
arguments: [3]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#datarace
- name: datarace
disabled: false
Expand All @@ -244,7 +223,7 @@ linters-settings:
- name: defer
disabled: false
arguments:
- [ "call-chain", "loop" ]
- ["call-chain", "loop"]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#dot-imports
- name: dot-imports
disabled: false
Expand Down Expand Up @@ -290,11 +269,11 @@ linters-settings:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-result-limit
- name: function-result-limit
disabled: false
arguments: [ 4 ]
arguments: [4]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#function-length
- name: function-length
disabled: true
arguments: [ 10, 0 ]
arguments: [10, 0]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#get-return
- name: get-return
disabled: false
Expand All @@ -317,23 +296,17 @@ linters-settings:
disabled: false
arguments:
- "^[a-z][a-z0-9]{0,}$"
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#imports-blacklist
- name: imports-blacklist
disabled: false
arguments:
- "crypto/md5"
- "crypto/sha1"
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#import-shadowing
- name: import-shadowing
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#line-length-limit
- name: line-length-limit
disabled: true
arguments: [ 80 ]
arguments: [80]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#max-public-structs
- name: max-public-structs
disabled: true
arguments: [ 3 ]
arguments: [3]
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#modifies-parameter
- name: modifies-parameter
disabled: false
Expand Down Expand Up @@ -374,10 +347,10 @@ linters-settings:
- name: string-format
disabled: false
arguments:
- - 'core.WriteError[1].Message'
- '/^([^A-Z]|$)/'
- - "core.WriteError[1].Message"
- "/^([^A-Z]|$)/"
- must not start with a capital letter
- - 'fmt.Errorf[0]'
- - "fmt.Errorf[0]"
- '/(^|[^\.!?])$/'
- must not end in punctuation
- - panic
Expand All @@ -404,8 +377,8 @@ linters-settings:
- name: var-naming
disabled: false
arguments:
- [ "ID" ] # AllowList
- [ "VM" ] # DenyList
- ["ID"] # AllowList
- ["VM"] # DenyList
- - upperCaseConst: true
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#var-declaration
- name: var-declaration
Expand Down Expand Up @@ -469,22 +442,20 @@ linters-settings:
# Default: false
all: true


linters:
disable-all: true

enable:
## enabled by default
- errcheck # checking for unchecked errors, these unchecked errors can be critical bugs in some cases
- gosimple # specializes in simplifying a code
- govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
# - govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- ineffassign # detects when assignments to existing variables are not used
- staticcheck # is a go vet on steroids, applying a ton of static analysis checks
- typecheck # like the front-end of a Go compiler, parses and type-checks Go code
- unused # checks for unused constants, variables, functions and types


# ## disabled by default
## disabled by default
- asasalint # checks for pass []any as any in variadic func(...any)
- asciicheck # checks that your code does not contain non-ASCII identifiers
- bidichk # checks for dangerous unicode character sequences
Expand Down Expand Up @@ -546,7 +517,6 @@ linters:
#- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
#- wastedassign # finds wasted assignment statements


## you may want to enable
#- decorder # checks declaration order and count of types, constants, variables and functions
#- exhaustruct # checks if all structure fields are initialized
Expand Down Expand Up @@ -593,7 +563,6 @@ linters:
#- structcheck # [deprecated, replaced by unused] finds unused struct fields
#- varcheck # [deprecated, replaced by unused] finds unused global variables and constants


issues:
# Maximum count of issues with the same text.
# Set to 0 to disable.
Expand All @@ -602,13 +571,13 @@ issues:

exclude-rules:
- source: "^//\\s*go:generate\\s"
linters: [ lll ]
linters: [lll]
- source: "(noinspection|TODO)"
linters: [ godot ]
linters: [godot]
- source: "//noinspection"
linters: [ gocritic ]
linters: [gocritic]
- source: "^\\s+if _, ok := err\\.\\([^.]+\\.InternalError\\); ok {"
linters: [ errorlint ]
linters: [errorlint]
- path: "_test\\.go"
linters:
- govet
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage
FROM golang:1.22 AS build-stage
FROM golang:1.23 AS build-stage
WORKDIR /app
COPY go.mod *go.sum ./
RUN go mod download
Expand Down
18 changes: 8 additions & 10 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
{
description = "PND backend dev environment";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";

outputs = {
self,
nixpkgs,
}: let
goVersion = 22; # Change this to update the whole stack
overlays = [(final: prev: {go = prev."go_1_${toString goVersion}";})];
goVersion = 23; # Change this to update the whole stack

supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
forEachSupportedSystem = f:
nixpkgs.lib.genAttrs supportedSystems (system:
f {
pkgs = import nixpkgs {inherit overlays system;};
pkgs = import nixpkgs {
inherit system;
overlays = [self.overlays.default];
};
});
in {
overlays.default = final: prev: {
go = final."go_1_${toString goVersion}";
};

devShells = forEachSupportedSystem ({pkgs}: {
default = pkgs.mkShell {
packages = with pkgs; [
# go (specified by overlay)
go_1_22
# go (version is specified by overlay)
go

# goimports, godoc, etc.
gotools
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/pet-sitter/pets-next-door-api

go 1.22
go 1.23

require (
firebase.google.com/go v3.13.0+incompatible
Expand Down