Beispiel #1
0
func getObject(c *s3.S3) {
	putObject(c)
	key := "aws/config.go"
	out, err := c.GetObject(
		&s3.GetObjectInput{
			Bucket: &bucket,
			Key:    &key,
		},
	)
	if err != nil {
		panic(err)
	}
	fmt.Println(out.Metadata)
	fmt.Println(*out.ContentLength)
	fmt.Println(*out.ContentType)

	b := make([]byte, 20)
	n, err := out.Body.Read(b)
	fmt.Printf("%-20s %-2v %v\n", b[:n], n, err)
}