Created
March 26, 2024 15:38
-
-
Save meowjesty/7a4da005ea0a18a0906dbbb555d37f19 to your computer and use it in GitHub Desktop.
go sample testing out mirrord/issue/2312
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 ( | |
"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