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

Chore/go version update #1066

Merged
merged 7 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: '1.20'
- uses: actions/checkout@v3
- uses: actions/cache@v2.1.7
with:
Expand All @@ -33,7 +33,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: '1.20'
- uses: actions/checkout@v3
- uses: actions/cache@v2.1.7
with:
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: '1.20'
- uses: actions/checkout@v3
- uses: actions/cache@v2.1.7
with:
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
steps:
- uses: actions/setup-go@v1
with:
go-version: 1.17
go-version: '1.20'
- uses: actions/checkout@v3
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2.1
Expand Down
1 change: 1 addition & 0 deletions client/package-lock.json

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

2 changes: 1 addition & 1 deletion docker/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17.7-alpine as build-step
FROM golang:1.20.7-alpine as build-step
RUN apk add --update --no-cache ca-certificates git
xxarupakaxx marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR /go/src/github.com/traPtitech/anke-to
Expand Down
2 changes: 1 addition & 1 deletion docker/staging/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax = docker/dockerfile:1.3.0

# build backend
FROM golang:1.17.7-alpine as server-build
FROM golang:1.20.7-alpine as server-build
RUN --mount=type=cache,target=/var/cache/apk \
apk add --update git

Expand Down
2 changes: 1 addition & 1 deletion docker/test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17.3-alpine as builder
FROM golang:1.20.7-alpine as builder
RUN apk add --update --no-cache ca-certificates git \
&& apk add --no-cache gcc libc-dev \
&& apk add --no-cache openssl
Expand Down
2 changes: 1 addition & 1 deletion docker/tuning/Dockerfile.server
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17.7-alpine as build-step
FROM golang:1.20.7-alpine as build-step
RUN apk add --update --no-cache ca-certificates git

WORKDIR /go/src/github.com/traPtitech/anke-to
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/traPtitech/anke-to

go 1.17
go 1.20

require (
github.com/golang/mock v1.6.0
Expand Down
16 changes: 8 additions & 8 deletions model/administrators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func setupAdministratorTest(t *testing.T) {
Session(&gorm.Session{NewDB: true}).
Create(&administratorTestQuestionnaireDatas[i].questionnaire).Error
if err != nil {
t.Errorf("failed to create questionnaire(%+v): %w", questionnaireData, err)
t.Errorf("failed to create questionnaire(%+v): %v", questionnaireData, err)
}

for _, administrator := range questionnaireData.administrators {
Expand All @@ -68,7 +68,7 @@ func setupAdministratorTest(t *testing.T) {
UserTraqid: administrator,
}).Error
if err != nil {
t.Errorf("failed to create administrator(%s): %w", administrator, err)
t.Errorf("failed to create administrator(%s): %v", administrator, err)
}
}
}
Expand Down Expand Up @@ -105,7 +105,7 @@ func insertAdministratorsTest(t *testing.T) {
break
}
if err != nil {
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %w", err)
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %v", err)
break
}

Expand Down Expand Up @@ -176,7 +176,7 @@ func insertAdministratorsTest(t *testing.T) {
Session(&gorm.Session{NewDB: true}).
Create(&testCase.args.questionnaire).Error
if err != nil {
t.Errorf("failed to create questionnaire(%+v): %w", testCase.args.questionnaire, err)
t.Errorf("failed to create questionnaire(%+v): %v", testCase.args.questionnaire, err)
}

err = administratorImpl.InsertAdministrators(ctx, testCase.args.questionnaire.ID, testCase.args.administrators)
Expand All @@ -198,7 +198,7 @@ func insertAdministratorsTest(t *testing.T) {
First(&actualAdministrators).Error

if errors.Is(err, gorm.ErrRecordNotFound) {
t.Errorf("no administrator(%s): %w", administrator, err)
t.Errorf("no administrator(%s): %v", administrator, err)
}
}
}
Expand Down Expand Up @@ -289,7 +289,7 @@ func deleteAdministratorsTest(t *testing.T) {
Session(&gorm.Session{NewDB: true}).
Create(&testCase.args.questionnaire).Error
if err != nil {
t.Errorf("failed to create questionnaire(%+v): %w", testCase.args.questionnaire, err)
t.Errorf("failed to create questionnaire(%+v): %v", testCase.args.questionnaire, err)
}

err = administratorImpl.DeleteAdministrators(ctx, testCase.args.questionnaire.ID)
Expand All @@ -309,7 +309,7 @@ func deleteAdministratorsTest(t *testing.T) {
Where("questionnaire_id = ?", testCase.args.questionnaire.ID).
Find(&administrators).Error
if err != nil {
t.Errorf("failed to get administrators(%s): %w", testCase.description, err)
t.Errorf("failed to get administrators(%s): %v", testCase.description, err)
}

assertion.Len(administrators, 0, testCase.description, "administrator length")
Expand Down Expand Up @@ -434,7 +434,7 @@ func checkQuestionnaireAdminTest(t *testing.T) {
break
}
if err != nil {
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %w", err)
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %v", err)
break
}

Expand Down
40 changes: 20 additions & 20 deletions model/questionnaires_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func setupQuestionnairesTest(t *testing.T) {
Session(&gorm.Session{NewDB: true}).
Create(data.questionnaire).Error
if err != nil {
t.Errorf("failed to create questionnaire(%+v): %w", data, err)
t.Errorf("failed to create questionnaire(%+v): %v", data, err)
}

for _, target := range data.targets {
Expand All @@ -299,7 +299,7 @@ func setupQuestionnairesTest(t *testing.T) {
UserTraqid: target,
}).Error
if err != nil {
t.Errorf("failed to create target: %w", err)
t.Errorf("failed to create target: %v", err)
}
}

Expand All @@ -317,7 +317,7 @@ func setupQuestionnairesTest(t *testing.T) {
UserTraqid: administrator,
}).Error
if err != nil {
t.Errorf("failed to create target: %w", err)
t.Errorf("failed to create target: %v", err)
}
}

Expand Down Expand Up @@ -468,7 +468,7 @@ func insertQuestionnaireTest(t *testing.T) {
Where("id = ?", questionnaireID).
First(&questionnaire).Error
if err != nil {
t.Errorf("failed to get questionnaire(%s): %w", testCase.description, err)
t.Errorf("failed to get questionnaire(%s): %v", testCase.description, err)
}

assertion.Equal(testCase.args.title, questionnaire.Title, testCase.description, "title")
Expand Down Expand Up @@ -657,7 +657,7 @@ func updateQuestionnaireTest(t *testing.T) {
Session(&gorm.Session{NewDB: true}).
Create(&questionnaire).Error
if err != nil {
t.Errorf("failed to create questionnaire(%s): %w", testCase.description, err)
t.Errorf("failed to create questionnaire(%s): %v", testCase.description, err)
}

createdAt := questionnaire.CreatedAt
Expand All @@ -680,7 +680,7 @@ func updateQuestionnaireTest(t *testing.T) {
Where("id = ?", questionnaireID).
First(&questionnaire).Error
if err != nil {
t.Errorf("failed to get questionnaire(%s): %w", testCase.description, err)
t.Errorf("failed to get questionnaire(%s): %v", testCase.description, err)
}

assertion.Equal(after.title, questionnaire.Title, testCase.description, "title")
Expand All @@ -702,7 +702,7 @@ func updateQuestionnaireTest(t *testing.T) {
break
}
if err != nil {
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %w", err)
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %v", err)
break
}

Expand Down Expand Up @@ -732,7 +732,7 @@ func updateQuestionnaireTest(t *testing.T) {
if err == nil {
t.Errorf("Succeeded with invalid questionnaireID")
} else {
t.Errorf("failed to update questionnaire(invalid questionnireID): %w", err)
t.Errorf("failed to update questionnaire(invalid questionnireID): %v", err)
}
}
}
Expand Down Expand Up @@ -783,7 +783,7 @@ func deleteQuestionnaireTest(t *testing.T) {
Session(&gorm.Session{NewDB: true}).
Create(&questionnaire).Error
if err != nil {
t.Errorf("failed to create questionnaire(%s): %w", testCase.description, err)
t.Errorf("failed to create questionnaire(%s): %v", testCase.description, err)
}

questionnaireID := questionnaire.ID
Expand All @@ -805,7 +805,7 @@ func deleteQuestionnaireTest(t *testing.T) {
Where("id = ?", questionnaireID).
Find(&questionnaire).Error
if err != nil {
t.Errorf("failed to get questionnaire(%s): %w", testCase.description, err)
t.Errorf("failed to get questionnaire(%s): %v", testCase.description, err)
}

assertion.True(questionnaire.DeletedAt.Valid, testCase.description, "id")
Expand All @@ -822,7 +822,7 @@ func deleteQuestionnaireTest(t *testing.T) {
break
}
if err != nil {
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %w", err)
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %v", err)
break
}

Expand All @@ -836,7 +836,7 @@ func deleteQuestionnaireTest(t *testing.T) {
if err == nil {
t.Errorf("Succeeded with invalid questionnaireID")
} else {
t.Errorf("failed to update questionnaire(invalid questionnireID): %w", err)
t.Errorf("failed to update questionnaire(invalid questionnireID): %v", err)
}
}
}
Expand Down Expand Up @@ -1075,7 +1075,7 @@ func getQuestionnairesTest(t *testing.T) {
Where("deleted_at IS NULL").
Count(&questionnaireNum).Error
if err != nil {
t.Errorf("failed to count questionnaire(%s): %w", testCase.description, err)
t.Errorf("failed to count questionnaire(%s): %v", testCase.description, err)
}

actualQuestionnaireIDs := []int{}
Expand Down Expand Up @@ -1190,7 +1190,7 @@ func getAdminQuestionnairesTest(t *testing.T) {
Where("id IN (?)", actualQuestionnaireIDs).
Find(&expectQuestionnaires).Error
if err != nil {
t.Errorf("failed to get questionnaires(%s): %w", testCase.description, err)
t.Errorf("failed to get questionnaires(%s): %v", testCase.description, err)
}

for _, expectQuestionnaire := range expectQuestionnaires {
Expand Down Expand Up @@ -1234,7 +1234,7 @@ func getQuestionnaireInfoTest(t *testing.T) {
break
}
if err != nil {
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %w", err)
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %v", err)
break
}

Expand Down Expand Up @@ -1568,7 +1568,7 @@ func getQuestionnaireLimitTest(t *testing.T) {
break
}
if err != nil {
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %w", err)
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %v", err)
break
}

Expand Down Expand Up @@ -1655,7 +1655,7 @@ func getQuestionnaireLimitByResponseIDTest(t *testing.T) {
break
}
if err != nil {
t.Errorf("failed to get response(make invalid responseID): %w", err)
t.Errorf("failed to get response(make invalid responseID): %v", err)
break
}

Expand Down Expand Up @@ -1746,7 +1746,7 @@ func getResponseReadPrivilegeInfoByResponseIDTest(t *testing.T) {
break
}
if err != nil {
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %w", err)
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %v", err)
break
}

Expand All @@ -1763,7 +1763,7 @@ func getResponseReadPrivilegeInfoByResponseIDTest(t *testing.T) {
break
}
if err != nil {
t.Errorf("failed to get response(make invalid responseID): %w", err)
t.Errorf("failed to get response(make invalid responseID): %v", err)
break
}

Expand Down Expand Up @@ -1917,7 +1917,7 @@ func getResponseReadPrivilegeInfoByQuestionnaireIDTest(t *testing.T) {
break
}
if err != nil {
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %w", err)
t.Errorf("failed to get questionnaire(make invalid questionnaireID): %v", err)
break
}

Expand Down