func distanceForStrings(source, target string) int {
	height := len(source) + 1
	width := len(target) + 1
	matrix := make([][]int, 2)
	for i := 0; i < 2; i++ {
		matrix[i] = make([]int, width)
		matrix[i][0] = i
	}
	for j := 1; j < width; j++ {
		matrix[0][j] = j
	}
	for i := 1; i < height; i++ {
		cur := matrix[i%2]
		prev := matrix[(i-1)%2]
		cur[0] = i
		for j := 1; j < width; j++ {
			delCost := prev[j] + 1
			matchSubCost := prev[j-1]
			if source[i-1] != target[j-1] {
				matchSubCost += 2
			}
			insCost := cur[j-1] + 1
			cur[j] = min(delCost, min(matchSubCost, insCost))
		}
	}
	return matrix[(height-1)%2][width-1]
}
DistanceForStrings returns the edit distance between source and target.
It has a runtime proportional to len(source) * len(target) and memory use
proportional to len(target).
Taken (simplified, for strings and with default options) from:
https://github.com/texttheater/golang-levenshtein
package similartext
import (
	"fmt"
	"reflect"
	"strings"
)
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}