This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func funcName() string { | |
pc, _, _, _ := runtime.Caller(1) | |
nm := runtime.FuncForPC(pc).Name() | |
dt := strings.Split(nm, ".") | |
return dt[len(dt)-1] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"path" | |
"github.com/blevesearch/bleve/v2" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func replaceChars(str, repl, with string) string { | |
var oldnew []string | |
for _, char := range repl { | |
oldnew = append(oldnew, string(char), with) | |
} | |
return strings.NewReplacer(oldnew...).Replace(str) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ds() { n=$(echo $1 | sed -e 's/^S/s/'); mv $1 $n; } |
OlderNewer