Skip to content

chore: update line-bot-sdk-go to v8.22.0 and rewrite README - #31

Merged
kkdai merged 1 commit into
masterfrom
chore/update-linebot-sdk-v8.22.0
Sep 1, 2026
Merged

chore: update line-bot-sdk-go to v8.22.0 and rewrite README#31
kkdai merged 1 commit into
masterfrom
chore/update-linebot-sdk-v8.22.0

Conversation

@kkdai

@kkdai kkdai commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

Brings the template up to the latest LINE Messaging API SDK, modernizes main.go for the Go version that comes with it, and gives the README a pass.

SDK / toolchain

  • github.com/line/line-bot-sdk-go/v8: v8.10.0 → v8.22.0
  • go.mod go directive: 1.23 → 1.25 — v8.22.0 declares go 1.25, so this is required, not optional
  • // +heroku goVersion pragma updated from go1.21 to go1.25 to match
  • CI: actions/setup-go@v4@v5, pinned Go 1.211.25 (the old pin could no longer build the new SDK)

The SDK bump itself needed no source changes — main.go compiled against v8.22.0 unmodified.

Go modernization

Checked main.go against the Modern Go Guidelines for Go 1.25; two applied:

  • Method-aware ServeMux pattern (Go 1.22+): the webhook is now registered as "POST /callback" rather than "/callback". LINE only ever POSTs to the webhook, so anything else now gets a 405 from the mux instead of falling into the handler and failing signature parsing.
  • cmp.Or: the PORT fallback collapses from a four-line empty-string check to cmp.Or(os.Getenv("PORT"), "5000").

README

  • Fixed typos (devloper, Rener, Hoe to)
  • Added What it does, Requirements, and an Environment variables table (ChannelSecret, ChannelAccessToken, optional PORT)
  • Added a Running locally section with the go run + ngrok tunnel flow, which was missing entirely
  • Added Making it your own — where the event loop is and how to extend it (other message types, richer reply messages, non-message events, push vs. reply)
  • Tightened the Render / Heroku deploy steps and the webhook-URL step, including the reminder to disable OA auto-reply
  • Switched to consistent ATX headings throughout

Test plan

  • go build ./...
  • go vet ./...
  • gofmt -l . clean
  • go test ./... (no test files in this repo)

- Bump github.com/line/line-bot-sdk-go/v8 from v8.10.0 to v8.22.0
- Bump go directive to 1.25 (required by the new SDK) and update the
  +heroku goVersion pragma to match
- Update CI to setup-go@v5 with Go 1.25 so it can still build
- Rewrite README: fix typos, document required env vars and the local
  dev / ngrok flow, add a "make it your own" section pointing at the
  event loop, and tidy the deploy steps for Render and Heroku
@kkdai
kkdai merged commit 1b410cd into master Sep 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant