···11# Auto detect text files and perform LF normalization
22* text=auto
33+44+# Force LF even on windows for testdata, means comparisons don't fail just
55+# because of line endings
66+**/testdata/* text eol=lf
77+88+# Txtar requires lf
99+*.txtar text eol=lf
+16-15
.gitignore
···11-# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,jetbrains+all,go
22-# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux,visualstudiocode,jetbrains+all,go
11+# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,goland+all,go
22+# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux,visualstudiocode,goland+all,go
3344### Go ###
55# If you prefer the allow list template instead of the deny list, see community template:
···17171818# Output of the go coverage tool, specifically when used with LiteIDE
1919*.out
2020-coverage.html
2121-2222-# Taskfile
2323-.task
2424-2525-# Comparative benchmarks
2626-before.txt
2727-after.txt
28202921# Dependency directories (remove the comment below to include it)
3022# vendor/
31233232-# Go workspace file
2424+# Go workspace files
3325go.work
2626+go.work.sum
34273535-### JetBrains+all ###
2828+### GoLand+all ###
3629# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
3730# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
3831···111104# Android studio 3.1+ serialized cache file
112105.idea/caches/build_file_checksums.ser
113106114114-### JetBrains+all Patch ###
107107+### GoLand+all Patch ###
115108# Ignore everything but code style settings and run configurations
116109# that are supposed to be shared within teams.
117110···170163171164### VisualStudioCode ###
172165.vscode/*
173173-!.vscode/settings.json
166166+# !.vscode/settings.json
174167!.vscode/tasks.json
175168!.vscode/launch.json
176169!.vscode/extensions.json
···213206# Windows shortcuts
214207*.lnk
215208216216-# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,jetbrains+all,go
209209+# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,goland+all,go
210210+211211+# Zed editor
212212+.zed/*
213213+# !.zed/settings.json
214214+!.zed/tasks.json
215215+216216+# Taskfile
217217+.task/
+4-11
.golangci.yml
···1111 extra-rules: true
12121313 golines:
1414- max-len: 140
1414+ max-len: 120
15151616linters:
1717 default: all
···2525 - funlen # Bad metric for complexity
2626 - ginkgolinter # I don't use whatever this is
2727 - gochecknoglobals # Globals are fine sometimes, use common sense
2828- - gocognit # Cmplexity with another name, don't need both
2928 - gocyclo # cyclop does this instead
3029 - godox # "todo" and "fixme" comments are allowed
3130 - goheader # No need
···4241 - unparam # gopls is better and more subtle
4342 - varnamelen # Lots of false positives of things that are fine
4443 - wrapcheck # Not every error must be wrapped
4545- - wsl # Very aggressive, some of this I like but tend to do anyway
4646- - wsl_v5 # As above, just newer version
4444+ - wsl # Deprecated
47454846 exclusions:
4947 presets:
5048 # See https://golangci-lint.run/usage/false-positives/#exclusion-presets
5151- - comments # Revive in particular has lots of false positives
5249 - std-error-handling
5350 - common-false-positives
5451 rules:
···5653 linters:
5754 - prealloc # These kinds of optimisations will make no difference to test code
5855 - gosec # Tests don't need security stuff
5959-5656+ - goconst # Sometimes repetition is okay in tests
6057 paths:
6158 - internal/diff
6259···158155 disabled: true # predeclared does this
159156160157 - name: unhandled-error
161161- arguments:
162162- - fmt\.(Fp|P)rint(ln|f)?
163163- - strings.Builder.Write(String|Byte)?
164164- - bytes.Buffer.Write(String|Byte)?
165165- - go/printer.(Fp|P)rint(ln|f)?
158158+ disabled: true # errcheck handles this
166159167160 - name: flag-parameter
168161 disabled: true # As far as I can work out this just doesn't like bools
···11[default.extend-words]
22+byt = "byt" # Useful name as byte is a keyword in go
23decorder = "decorder" # Name of a Go linter
44+55+[files]
66+extend-exclude = ["go.mod", "go.sum"]
+2-2
LICENSE
···11-21MIT License
3244-Copyright (c) 2024, Tom Fleet
33+Copyright (c) 2025, Tom Fleet
5465Permission is hereby granted, free of charge, to any person obtaining a copy
76of this software and associated documentation files (the "Software"), to deal
···2019LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2120OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2221SOFTWARE.
2222+