diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 0000000..152e18d --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "os" + "os/exec" + + "github.com/davecgh/go-spew/spew" +) + +func main() { + cmd := "ls" + args := []string{"-ll"} + out, err := exec.Command(cmd, args...).Output() + spew.Dump(string(out), err) + if err := exec.Command(cmd, args...).Run(); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } + fmt.Println("Successfully halved image in size") +} diff --git a/ioreader/main.go b/ioreader/main.go new file mode 100644 index 0000000..c60b23d --- /dev/null +++ b/ioreader/main.go @@ -0,0 +1,12 @@ +package main + +// https://medium.com/@matryer/golang-advent-calendar-day-seventeen-io-reader-in-depth-6f744bb4320b + +// Take io.Reader when you can +// If you’re designing a package or utility (even if it’s an internal thing that nobody will ever see) +// rather than taking in strings or []byte slices, consider taking in an io.Reader if you can for data sources. +// Because suddenly, your code will work with every type that implements io.Reader. + +func main() { + +}