1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-06 06:10:18 +00:00

add some useful func

This commit is contained in:
skyblue
2013-12-11 22:18:45 +08:00
parent 52ebaece73
commit a43a1be0b4
4 changed files with 29 additions and 5 deletions

View File

@ -43,7 +43,7 @@ func LookFile(filename string, paths ...string) (fullpath string, err error) {
// like command grep -E
// for example: GrepE(`^hello`, "hello.txt")
// \n is striped while read
func GrepE(patten string, filename string) (lines []string, err error) {
func GrepFile(patten string, filename string) (lines []string, err error) {
re, err := regexp.Compile(patten)
if err != nil {
return