Copyright (c) 2012-2016 The go-diff authors. All rights reserved. https://github.com/sergi/go-diff See the included LICENSE file for license details. go-diff is a Go implementation of Google's Diff, Match, and Patch library Original library is Copyright (c) 2006 Google Inc. http://code.google.com/p/google-diff-match-patch/

package diffmatchpatch

import (
	
	
)
unescaper unescapes selected chars for compatibility with JavaScript's encodeURI. In speed critical applications this could be dropped since the receiving application will certainly decode these fine. Note that this function is case-sensitive. Thus "%3F" would not be unescaped. But this is ok because it is only called with the output of HttpUtility.UrlEncode which returns lowercase hex. Example: "%3f" -> "?", "%24" -> "$", etc.
var unescaper = strings.NewReplacer(
	"%21", "!", "%7E", "~", "%27", "'",
	"%28", "(", "%29", ")", "%3B", ";",
	"%2F", "/", "%3F", "?", "%3A", ":",
	"%40", "@", "%26", "&", "%3D", "=",
	"%2B", "+", "%24", "$", "%2C", ",", "%23", "#", "%2A", "*")
indexOf returns the first index of pattern in str, starting at str[i].
func ( string,  string,  int) int {
	if  > len()-1 {
		return -1
	}
	if  <= 0 {
		return strings.Index(, )
	}
	 := strings.Index([:], )
	if  == -1 {
		return -1
	}
	return  + 
}
lastIndexOf returns the last index of pattern in str, starting at str[i].
func ( string,  string,  int) int {
	if  < 0 {
		return -1
	}
	if  >= len() {
		return strings.LastIndex(, )
	}
	,  := utf8.DecodeRuneInString([:])
	return strings.LastIndex([:+], )
}
runesIndexOf returns the index of pattern in target, starting at target[i].
func (,  []rune,  int) int {
	if  > len()-1 {
		return -1
	}
	if  <= 0 {
		return runesIndex(, )
	}
	 := runesIndex([:], )
	if  == -1 {
		return -1
	}
	return  + 
}

func (,  []rune) bool {
	if len() != len() {
		return false
	}
	for ,  := range  {
		if  != [] {
			return false
		}
	}
	return true
}
runesIndex is the equivalent of strings.Index for rune slices.
func (,  []rune) int {
	 := len() - len()
	for  := 0;  <= ; ++ {
		if runesEqual([:+len()], ) {
			return 
		}
	}
	return -1