# sergi/go-diff

Diff, match and patch text in Go

Repository: https://github.com/sergi/go-diff
Canonical: https://ross.abutalabs.com/products/go-diff
Language: Go
License: MIT
License Family: permissive
Last push: 2025-06-05T16:30:21+00:00

## Health v2 (maintenance only)
Score: 44/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 25, release rhythm 35, longevity 100
- inputs: {"age_days": 5011, "days_push": 454, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2087, forks 228 (observed 2026-08-28T04:06:12.065138+00:00)

## What it is
A Go library port of Google's diff-match-patch library that computes text differences, performs fuzzy text matching, and applies patches to text. It provides the core algorithms needed for synchronizing plain text.

## Use cases
- compare two texts and show their differences in go
- apply patches to text files programmatically
- fuzzy match a string inside a larger text
- implement text synchronization in a go application
- generate diffs for version tracking of plain text
- port diff-match-patch functionality to go

## When to choose
- you need diff, match, and patch algorithms in a Go project
- you want a Go port of the well-tested google-diff-match-patch algorithms
- you need fuzzy text matching, not just exact diffs

## When to avoid
- you need binary file diffs rather than plain text
- you need a CLI diff tool rather than a library
- you need word-processor-style rich text or semantic diffs out of the box

## Facets
- artifact type: library
- maturity: stable
- function: parser, developer-tools
- domain: developer-tools, text-editors
- platform: go, cross-platform
- tags: diff, patch, fuzzy-matching, text-comparison, diff-match-patch, algorithms

## Member repositories
- sergi/go-diff (main) score 44

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:12.065138+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:55:46.660319+00:00, confidence not recorded.
  - readme: https://github.com/sergi/go-diff (fetched 2026-08-28T04:06:12.065138+00:00, sha 8f8e9b26aa19)
- Data as of 2026-08-30T08:39:29.467469+00:00.
