func ExampleOpen() { s3util.DefaultConfig.AccessKey = "...access key..." s3util.DefaultConfig.SecretKey = "...secret key..." r, _ := s3util.Open("https://mybucket.s3.amazonaws.com/log.txt", nil) w, _ := os.Create("out.txt") io.Copy(w, r) w.Close() }
func open(s string) (io.ReadCloser, error) { if isURL(s) { return s3util.Open(s, nil) } return os.Open(s) }