惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
D
Docker
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
Vercel News
Vercel News
F
Fortinet All Blogs
B
Blog
Recent Announcements
Recent Announcements
A
About on SuperTechFans
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
C
Check Point Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
月光博客
月光博客

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Stop Shipping Breaking Go APIs by Accident
alexey.zh · 2026-05-07 · via DEV Community

Every Go release has one question that matters more than the diff itself:

Did we break something users compile against?

A pull request can look harmless. A few files changed, a type moved, a method now returns an error, a struct field disappeared. The commit history may look clean. The changelog may sound reasonable.

But users do not depend on your commit messages.

They depend on your public Go API.

That is the purpose of relimpact: a small, fast tool that compares two Git refs and reports what changed in the exported Go API.

Not every file.
Not every commit.
Not every line.

Only the public API surface that users can import, call, implement, or compile against.

Why another report?

A raw git diff is great when you want to inspect implementation details.

A changelog is great when you want to explain a release to humans.

But neither of them is the best tool for answering:

Which public Go symbols changed between these two refs?

That question needs a different view.

For example, this is what matters before a release:

- func Load(path string) *Config
+ func Load(path string) (*Config, error)

Enter fullscreen mode Exit fullscreen mode

That is not just “one line changed”.

That is a breaking API change.

And this is useful, but not breaking:

+ func FromEnv(prefix string) (*Config, error)

Enter fullscreen mode Exit fullscreen mode

That is a new public API.

relimpact separates those two ideas clearly:

  • Breaking changes: changed or removed public API.
  • New API: compatible additions.

The result is a report that is easier to review in a pull request and easier to attach to a release.

It is not a diff tool

relimpact is intentionally narrow.

It does not try to replace git diff.
It does not generate a raw changelog.
It does not summarize commits.
It does not care how many commits happened between two refs.

Instead, it snapshots the exported Go API at one ref, snapshots it again at another ref, and compares the API surface.

That means the report is based on API changes between refs, not on commit messages.

This distinction matters.

A messy commit history can still produce a clean API report.

A small commit can still produce a breaking public API change.

That is the whole point.

What the report looks like

A Markdown report is designed for pull request comments.

It starts with a small compatibility summary, then puts breaking changes first:

There is also an HTML report for CI artifacts and release review, but Markdown is usually the best format for pull requests.

Add it to a GitHub pull request

Here is a simple GitHub Actions workflow that runs relimpact, generates a Markdown report, and posts it as a sticky pull request comment.

name: API compatibility

on:
  pull_request:
    branches: [ master ]

permissions:
  contents: read
  pull-requests: write

jobs:
  relimpact:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: actions/setup-go@v5
        with:
          go-version: "1.25"

      - name: Install relimpact
        run: |
          go install github.com/hashmap-kz/relimpact@latest

      - name: Generate Markdown API report
        run: |
          relimpact \
            --old="${{ github.event.pull_request.base.sha }}" \
            --new="${{ github.event.pull_request.head.sha }}" \
            --format=markdown \
            --output api-report.md

      - name: Comment API report on PR
        uses: marocchino/sticky-pull-request-comment@v2
        with:
          header: relimpact-api-report
          recreate: true
          path: api-report.md

Enter fullscreen mode Exit fullscreen mode

That is all.

Every pull request gets a public API compatibility report.

If nothing public has changed, the report stays quiet.

If a method signature changed, a field disappeared, or a new exported type appeared, reviewers see it without digging through implementation diffs.

HTML as a CI artifact

For release review, you may also want a browser-friendly report:

      - name: Generate HTML API report
        run: |
          relimpact \
            --old="${{ github.event.pull_request.base.sha }}" \
            --new="${{ github.event.pull_request.head.sha }}" \
            --format=html \
            --output api-report.html

      - name: Upload HTML API report
        uses: actions/upload-artifact@v4
        with:
          name: api-report
          path: api-report.html

Enter fullscreen mode Exit fullscreen mode

The HTML report keeps the same structure as Markdown:

  1. verdict
  2. summary
  3. breaking changes
  4. new API

The difference is presentation: package navigation, cleaner grouping, and a better browser view.

Why this matters

Go makes public API changes feel deceptively simple.

Changing a return value is easy.

Removing a field is easy.

Renaming a method is easy.

But for users, those changes may mean failed builds, broken imports, or migration work.

relimpact makes that visible before the release.

It helps reviewers focus on the question that actually matters:

Are we changing the contract?

Easy to try

relimpact is a single binary.

No server.
No database.
No external service.
No AI.

It works from your Git repository and compares two refs:

relimpact --old=v1.0.0 --new=HEAD

Enter fullscreen mode Exit fullscreen mode

Generate HTML:

relimpact --old=v1.0.0 --new=HEAD --format=html --output api-report.html

Enter fullscreen mode Exit fullscreen mode

Install with Go:

go install github.com/hashmap-kz/relimpact@latest

Enter fullscreen mode Exit fullscreen mode

The project is here:

https://github.com/hashmap-kz/relimpact

If the idea feels useful, starring the repository is always motivating. It helps show that small, focused Go tools still matter.