Skip to content

Commit 858d4a2

Browse files
massongitrenovate[bot]github-actions[bot]claude
authored
super-linterアップデート (#224)
* Update super-linter/super-linter action to v8.3.1 * gitleaksをアップデートしてあげたよ! (#223) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Dockerイメージバージョン更新スクリプトにバージョン変更チェックを追加 update_go_version.shスクリプトに、Dockerfileのベースイメージバージョンが 実際に変更された場合のみdigestを取得する処理を追加した。 これにより、バージョンが変わらない場合の不要なdocker buildxコマンド実行を 回避し、スクリプトの実行効率を改善した。 変更内容: - Dockerfileから現在のイメージタグを抽出 - 新しいGoバージョンで置き換えた新イメージタグを生成 - イメージタグが変わらない場合は早期リターン - 変わる場合のみdigestを取得してDockerfileを更新 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * lib/httpをlib/httpclientにリネームしてreviveエラーを修正 Go標準ライブラリのhttpパッケージと名前が衝突していたため、 reviveのvar-namingルールでエラーが発生していた。 これを解消するため、lib/httpディレクトリをlib/httpclientに リネームし、すべてのインポート文とパッケージ宣言を更新した。 変更内容: - lib/http/ → lib/httpclient/ にディレクトリをリネーム - package http → package httpclient に変更 - すべてのインポート文を更新 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Goのバージョンを直してあげたよ! (#225) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2c9a539 commit 858d4a2

File tree

13 files changed

+49
-40
lines changed

13 files changed

+49
-40
lines changed

.github/workflows/pr-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
cache: npm
3939
node-version-file: package.json
4040
- run: bash "${GITHUB_WORKSPACE}/scripts/pr_test/pr_super_lint/npm_ci.sh"
41-
- uses: super-linter/super-linter/slim@502f4fe48a81a392756e173e39a861f8c8efe056 # v8.3.0
41+
- uses: super-linter/super-linter/slim@47984f49b4e87383eed97890fe2dca6063bbd9c3 # v8.3.1
4242
env:
4343
LINTER_RULES_PATH: .
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
repos:
33
- repo: https://github.com/zricethezav/gitleaks
4-
rev: v8.29.1
4+
rev: v8.30.0
55
hooks:
66
- id: gitleaks

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.25.4-bookworm@sha256:e17419604b6d1f9bc245694425f0ec9b1b53685c80850900a376fb10cb0f70cb AS builder
1+
FROM golang:1.25.5-bookworm@sha256:09f53deea14d4019922334afe6258b7b776afc1d57952be2012f2c8c4076db05 AS builder
22

33
WORKDIR /app
44

cmd/health_check/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
"github.com/cockroachdb/errors"
1010

11-
libHttp "hato-bot-go/lib/http"
11+
"hato-bot-go/lib/httpclient"
1212
)
1313

1414
func main() {
@@ -23,9 +23,9 @@ func main() {
2323
panic(errors.Wrap(err, "Failed to http.NewRequestWithContext"))
2424
}
2525

26-
resp, err := libHttp.ExecuteHTTPRequest(http.DefaultClient, req)
26+
resp, err := httpclient.ExecuteHTTPRequest(http.DefaultClient, req)
2727
if err != nil {
28-
panic(errors.Wrap(err, "Failed to libHttp.ExecuteHTTPRequest"))
28+
panic(errors.Wrap(err, "Failed to httpclient.ExecuteHTTPRequest"))
2929
}
3030
defer func(Body io.ReadCloser) {
3131
if closeErr := Body.Close(); closeErr != nil {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module hato-bot-go
22

3-
go 1.25.4
3+
go 1.25.5
44

55
require (
66
github.com/cockroachdb/errors v1.12.0

lib/amesh/amesh.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"golang.org/x/exp/constraints"
2323

2424
"hato-bot-go/lib"
25-
libHttp "hato-bot-go/lib/http"
25+
"hato-bot-go/lib/httpclient"
2626
)
2727

2828
const Version = "1.0"
@@ -282,9 +282,9 @@ func ParseLocationWithClient(ctx context.Context, req *ParseLocationWithClientPa
282282
if err != nil {
283283
return nil, errors.Wrap(err, "Failed to http.NewRequestWithContext")
284284
}
285-
resp, err := libHttp.ExecuteHTTPRequest(req.Client, httpReq)
285+
resp, err := httpclient.ExecuteHTTPRequest(req.Client, httpReq)
286286
if err != nil {
287-
return nil, errors.Wrap(err, "Failed to libHttp.ExecuteHTTPRequest")
287+
return nil, errors.Wrap(err, "Failed to httpclient.ExecuteHTTPRequest")
288288
}
289289

290290
body, err := handleHTTPResponse(resp)
@@ -513,7 +513,7 @@ func downloadTile(ctx context.Context, client *http.Client, tileURL string) (img
513513
}
514514
req.Header.Set("User-Agent", "hato-bot-go/"+Version)
515515

516-
resp, err := libHttp.ExecuteHTTPRequest(client, req)
516+
resp, err := httpclient.ExecuteHTTPRequest(client, req)
517517
if err != nil {
518518
return nil, errors.Wrap(err, "Failed to ExecuteHTTPRequest")
519519
}
@@ -536,13 +536,13 @@ func makeHTTPRequest(ctx context.Context, client *http.Client, url string) (*htt
536536
if err != nil {
537537
return nil, errors.Wrap(err, "Failed to http.NewRequestWithContext")
538538
}
539-
resp, err := libHttp.ExecuteHTTPRequest(client, req)
539+
resp, err := httpclient.ExecuteHTTPRequest(client, req)
540540
if err != nil {
541-
if errors.Is(err, libHttp.ErrHTTPRequestError) {
541+
if errors.Is(err, httpclient.ErrHTTPRequestError) {
542542
return &httpRequestResult{Body: nil, IsEmpty: true}, nil
543543
}
544544

545-
return nil, errors.Wrap(err, "Failed to libHttp.ExecuteHTTPRequest")
545+
return nil, errors.Wrap(err, "Failed to httpclient.ExecuteHTTPRequest")
546546
}
547547

548548
body, err := handleHTTPResponse(resp)

lib/amesh/amesh_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
"hato-bot-go/lib"
1717
"hato-bot-go/lib/amesh"
18-
libHttp "hato-bot-go/lib/http"
18+
"hato-bot-go/lib/httpclient"
1919
)
2020

2121
// httpMockConfig モックHTTPクライアントの設定
@@ -396,7 +396,7 @@ func TestParseLocationWithClient(t *testing.T) {
396396
{
397397
name: "成功したジオコーディング",
398398
params: &amesh.ParseLocationWithClientParams{
399-
Client: libHttp.NewMockHTTPClient(http.StatusOK, `{
399+
Client: httpclient.NewMockHTTPClient(http.StatusOK, `{
400400
"Feature": [
401401
{
402402
"Name": "東京都",
@@ -421,7 +421,7 @@ func TestParseLocationWithClient(t *testing.T) {
421421
{
422422
name: "座標文字列の解析",
423423
params: &amesh.ParseLocationWithClientParams{
424-
Client: libHttp.NewMockHTTPClient(http.StatusOK, `{
424+
Client: httpclient.NewMockHTTPClient(http.StatusOK, `{
425425
"Feature": [
426426
{
427427
"Name": "東京都",
@@ -446,7 +446,7 @@ func TestParseLocationWithClient(t *testing.T) {
446446
{
447447
name: "空の場所は東京がデフォルト",
448448
params: &amesh.ParseLocationWithClientParams{
449-
Client: libHttp.NewMockHTTPClient(http.StatusOK, `{
449+
Client: httpclient.NewMockHTTPClient(http.StatusOK, `{
450450
"Feature": [
451451
{
452452
"Name": "東京都",
@@ -471,7 +471,7 @@ func TestParseLocationWithClient(t *testing.T) {
471471
{
472472
name: "座標文字列(整数)",
473473
params: &amesh.ParseLocationWithClientParams{
474-
Client: libHttp.NewMockHTTPClient(http.StatusOK, `{
474+
Client: httpclient.NewMockHTTPClient(http.StatusOK, `{
475475
"Feature": [
476476
{
477477
"Name": "東京都",
@@ -495,7 +495,7 @@ func TestParseLocationWithClient(t *testing.T) {
495495
{
496496
name: "無効な座標文字列(1つの数値のみ)",
497497
params: &amesh.ParseLocationWithClientParams{
498-
Client: libHttp.NewMockHTTPClient(http.StatusOK, `{
498+
Client: httpclient.NewMockHTTPClient(http.StatusOK, `{
499499
"Feature": [
500500
{
501501
"Name": "東京都",
@@ -519,18 +519,18 @@ func TestParseLocationWithClient(t *testing.T) {
519519
{
520520
name: "無効な座標文字列",
521521
params: &amesh.ParseLocationWithClientParams{
522-
Client: libHttp.NewMockHTTPClient(http.StatusBadRequest, `{"Error": "Invalid place"}`),
522+
Client: httpclient.NewMockHTTPClient(http.StatusBadRequest, `{"Error": "Invalid place"}`),
523523
GeocodeRequest: amesh.GeocodeRequest{
524524
Place: "invalid coordinates",
525525
APIKey: "test_key",
526526
},
527527
},
528-
expectError: libHttp.ErrHTTPRequestError,
528+
expectError: httpclient.ErrHTTPRequestError,
529529
},
530530
{
531531
name: "無効な座標フォーマット",
532532
params: &amesh.ParseLocationWithClientParams{
533-
Client: libHttp.NewMockHTTPClient(http.StatusOK, `{
533+
Client: httpclient.NewMockHTTPClient(http.StatusOK, `{
534534
"Feature": [
535535
{
536536
"Name": "東京都",
@@ -550,18 +550,18 @@ func TestParseLocationWithClient(t *testing.T) {
550550
{
551551
name: "APIがエラーステータスを返す",
552552
params: &amesh.ParseLocationWithClientParams{
553-
Client: libHttp.NewMockHTTPClient(http.StatusBadRequest, `{"Error": "Invalid API key"}`),
553+
Client: httpclient.NewMockHTTPClient(http.StatusBadRequest, `{"Error": "Invalid API key"}`),
554554
GeocodeRequest: amesh.GeocodeRequest{
555555
Place: "東京",
556556
APIKey: "invalid_key",
557557
},
558558
},
559-
expectError: libHttp.ErrHTTPRequestError,
559+
expectError: httpclient.ErrHTTPRequestError,
560560
},
561561
{
562562
name: "結果が見つからない",
563563
params: &amesh.ParseLocationWithClientParams{
564-
Client: libHttp.NewMockHTTPClient(http.StatusOK, `{"Feature": []}`),
564+
Client: httpclient.NewMockHTTPClient(http.StatusOK, `{"Feature": []}`),
565565
GeocodeRequest: amesh.GeocodeRequest{
566566
Place: "nonexistent place",
567567
APIKey: "test_key",
@@ -572,7 +572,7 @@ func TestParseLocationWithClient(t *testing.T) {
572572
{
573573
name: "不正なJSON",
574574
params: &amesh.ParseLocationWithClientParams{
575-
Client: libHttp.NewMockHTTPClient(http.StatusOK, `{"Feature": [invalid json}`),
575+
Client: httpclient.NewMockHTTPClient(http.StatusOK, `{"Feature": [invalid json}`),
576576
GeocodeRequest: amesh.GeocodeRequest{
577577
Place: "東京",
578578
APIKey: "test_key",
@@ -583,7 +583,7 @@ func TestParseLocationWithClient(t *testing.T) {
583583
{
584584
name: "座標数が足りない場合",
585585
params: &amesh.ParseLocationWithClientParams{
586-
Client: libHttp.NewMockHTTPClient(http.StatusOK, `{
586+
Client: httpclient.NewMockHTTPClient(http.StatusOK, `{
587587
"Feature": [
588588
{
589589
"Name": "東京都",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package http
1+
package httpclient
22

33
import (
44
"net/http"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package http
1+
package httpclient
22

33
import (
44
"io"

lib/misskey/bot.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
"hato-bot-go/lib"
1919
"hato-bot-go/lib/amesh"
20-
libHttp "hato-bot-go/lib/http"
20+
"hato-bot-go/lib/httpclient"
2121
)
2222

2323
// エラー定数
@@ -121,7 +121,7 @@ func (bot *Bot) UploadFile(ctx context.Context, reader io.Reader, fileName strin
121121
req.Header.Set("Content-Type", writer.FormDataContentType())
122122
req.Header.Set("User-Agent", bot.UserAgent)
123123

124-
resp, err := libHttp.ExecuteHTTPRequest(bot.BotSetting.Client, req)
124+
resp, err := httpclient.ExecuteHTTPRequest(bot.BotSetting.Client, req)
125125
if err != nil {
126126
return nil, errors.Wrap(err, "Failed to executeHTTPRequest")
127127
}
@@ -308,7 +308,7 @@ func (bot *Bot) apiRequest(ctx context.Context, endpoint string, data map[string
308308
req.Header.Set("Content-Type", "application/json")
309309
req.Header.Set("User-Agent", bot.UserAgent)
310310

311-
resp, err := libHttp.ExecuteHTTPRequest(bot.BotSetting.Client, req)
311+
resp, err := httpclient.ExecuteHTTPRequest(bot.BotSetting.Client, req)
312312
if err != nil {
313313
return nil, errors.Wrap(err, "Failed to executeHTTPRequest")
314314
}

0 commit comments

Comments
 (0)