Skip to content

Instantly share code, notes, and snippets.

@meowjesty
Created March 26, 2024 15:38
Show Gist options
  • Save meowjesty/7a4da005ea0a18a0906dbbb555d37f19 to your computer and use it in GitHub Desktop.
Save meowjesty/7a4da005ea0a18a0906dbbb555d37f19 to your computer and use it in GitHub Desktop.
go sample testing out mirrord/issue/2312
package main
import (
"net/http"
"os/exec"
)
func resolve(address string) {
client := http.Client{}
response, err := client.Get(address)
if err != nil {
println("FAIL -> Http error: ", err.Error())
} else {
println(response)
}
}
func execute(name string, arg ...string) {
println("\n\t\t<<<FORKING>>>\n")
out, err := exec.Command(name, arg...).CombinedOutput()
if err != nil {
println("FAIL -> We have an error: ", err.Error())
}
println(string(out))
}
func main() {
// resolve("https://github.com")
// resolve("https://google.com")
// execute("ls", "-a")
execute("curl", "google.com")
// execute(
// "git",
// "clone",
// "https://github.com/sarcasticadmin/empty-repo.git",
// )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment