patchup

command module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 12 Imported by: 0

README

Patchup

License Go Report Card Go Reference Version

Patchup is a command line tool to increment the patch part of your version number so you just have to think about major and minor parts. It will parse a source file to find and increment a patch var/const, it will also update a timestamp var/const if you need it. Target variables or constants must be package-level declarations assigned explicit string literals. Patchup should be called before each build. The patch target is required; the command exits with an error if it cannot be found. The timestamp target is optional by default, and you can disable it explicitly with -tn "". Pass -pn "" if you want to update only the timestamp target.

Installation:

go install github.com/catamat/patchup@latest

Options:

-fn [string]
	Go source file name (default "version.go")

-pn [string]
	Patch var/const name (default "versionPatch")

-tf [string]
	Timestamp output format (default "0601021504")

-tn [string]
	Timestamp var/const name (default "versionTimestamp")

Usage:

Before:

// version.go

package main

const versionMajor = "1"
const versionMinor = "0"
const versionPatch = "0"
const versionTimestamp = ""

const version = versionMajor + "." + versionMinor + "." + versionPatch

Command:

./patchup -fn version.go

After:

// version.go

package main

const versionMajor = "1"
const versionMinor = "0"
const versionPatch = "1"
const versionTimestamp = "2010051551"

const version = versionMajor + "." + versionMinor + "." + versionPatch

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL