Skip to content

Instantly share code, notes, and snippets.

@EricMountain
EricMountain / ansible-aur-pkg-installer.md
Created April 30, 2017 19:12
download, build, and install aur packages with ansible
@EricMountain
EricMountain / Golang-binary-versioning.md
Last active August 29, 2015 14:27 — forked from rafecolton/Golang-binary-versioning.md
Copypasta for easy versioning for your Go binaries

Golang Binary Versioning Trick

To use, place the code in version_trick.go in your project. Don't forget to change the namespace to match yours to the actual name of your package.

In addition to version_trick.go, there's a makefile-snippet, that includes the secret sauce for making this trick work. Be sure to change the package name there as well.

Enjoy!

P.S. Special thanks to @meatballhat by way of @syscomet for showing me this trick!

#!/usr/bin/env python3
def search(pattern, string, matches=None):
if matches is None: matches = dict()
maxMatchLen = len(string)
while(maxMatchLen != 0):
match = string[0:maxMatchLen]
head = pattern[0]
matchesCopy = dict(matches)