Does strings.Replace replace some strings in binary files?

Hello, i have a binary file, i do replace some strings in that binary file via sed (linux command)
Can we do the same process via golang? like reading the file as string in a variable than using strings.Replace ?

Sure you can. The bytes package has a Replace function that you should be able to use if you can load the whole file into a []byte slice, e.g. with ioutil.ReadFile.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.