Hey All, I am trying to iterate over an array, match the lines in a file and then delete all occurrences of the lines in the file.
See this example. *Array* var abcd = [5]string{ "one two", "three four fix", "six", "seven eight nine ten", "eleven twelve thirteen fourteen fifteen", } *My File* <some text> - one two <some text> - seven eight nine ten <some text> - one two <some text> - nineteen <some text> - eleven twelve thirteen fourteen fifteen <some text> - sixteen seventeen eighteen *Desired File* <some text> - nineteen <some text> - sixteen seventeen eighteen In Bash, I would have done something like this. for i in "${abcd[@]}" do sed -i "/$i/d" <my_file> done PS: I am new to GoLang and trying to write a git pre-commit hook. Thanks in advance. Regards. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.