diff options
author | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
---|---|---|
committer | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
commit | 107c1cdb09c575aa2f61d97f48d8587eb6bada4c (patch) | |
tree | ca7d008643efc555c388baeaf1d986e0b6b3e28c /vendor/github.com/ulikunitz/xz/README.md | |
parent | 844b5a68d8af4791755b8f0ad293cc99f5959183 (diff) | |
download | terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.gz terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.zst terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.zip |
Upgrade to 0.12
Diffstat (limited to 'vendor/github.com/ulikunitz/xz/README.md')
-rw-r--r-- | vendor/github.com/ulikunitz/xz/README.md | 72 |
1 files changed, 37 insertions, 35 deletions
diff --git a/vendor/github.com/ulikunitz/xz/README.md b/vendor/github.com/ulikunitz/xz/README.md index 969ae7a..0a2dc82 100644 --- a/vendor/github.com/ulikunitz/xz/README.md +++ b/vendor/github.com/ulikunitz/xz/README.md | |||
@@ -12,46 +12,48 @@ have been developed over a long time and are highly optimized. However | |||
12 | there are a number of improvements planned and I'm very optimistic about | 12 | there are a number of improvements planned and I'm very optimistic about |
13 | parallel compression and decompression. Stay tuned! | 13 | parallel compression and decompression. Stay tuned! |
14 | 14 | ||
15 | # Using the API | 15 | ## Using the API |
16 | 16 | ||
17 | The following example program shows how to use the API. | 17 | The following example program shows how to use the API. |
18 | 18 | ||
19 | package main | 19 | ```go |
20 | 20 | package main | |
21 | import ( | 21 | |
22 | "bytes" | 22 | import ( |
23 | "io" | 23 | "bytes" |
24 | "log" | 24 | "io" |
25 | "os" | 25 | "log" |
26 | 26 | "os" | |
27 | "github.com/ulikunitz/xz" | 27 | |
28 | ) | 28 | "github.com/ulikunitz/xz" |
29 | 29 | ) | |
30 | func main() { | 30 | |
31 | const text = "The quick brown fox jumps over the lazy dog.\n" | 31 | func main() { |
32 | var buf bytes.Buffer | 32 | const text = "The quick brown fox jumps over the lazy dog.\n" |
33 | // compress text | 33 | var buf bytes.Buffer |
34 | w, err := xz.NewWriter(&buf) | 34 | // compress text |
35 | if err != nil { | 35 | w, err := xz.NewWriter(&buf) |
36 | log.Fatalf("xz.NewWriter error %s", err) | 36 | if err != nil { |
37 | } | 37 | log.Fatalf("xz.NewWriter error %s", err) |
38 | if _, err := io.WriteString(w, text); err != nil { | ||
39 | log.Fatalf("WriteString error %s", err) | ||
40 | } | ||
41 | if err := w.Close(); err != nil { | ||
42 | log.Fatalf("w.Close error %s", err) | ||
43 | } | ||
44 | // decompress buffer and write output to stdout | ||
45 | r, err := xz.NewReader(&buf) | ||
46 | if err != nil { | ||
47 | log.Fatalf("NewReader error %s", err) | ||
48 | } | ||
49 | if _, err = io.Copy(os.Stdout, r); err != nil { | ||
50 | log.Fatalf("io.Copy error %s", err) | ||
51 | } | ||
52 | } | 38 | } |
39 | if _, err := io.WriteString(w, text); err != nil { | ||
40 | log.Fatalf("WriteString error %s", err) | ||
41 | } | ||
42 | if err := w.Close(); err != nil { | ||
43 | log.Fatalf("w.Close error %s", err) | ||
44 | } | ||
45 | // decompress buffer and write output to stdout | ||
46 | r, err := xz.NewReader(&buf) | ||
47 | if err != nil { | ||
48 | log.Fatalf("NewReader error %s", err) | ||
49 | } | ||
50 | if _, err = io.Copy(os.Stdout, r); err != nil { | ||
51 | log.Fatalf("io.Copy error %s", err) | ||
52 | } | ||
53 | } | ||
54 | ``` | ||
53 | 55 | ||
54 | # Using the gxz compression tool | 56 | ## Using the gxz compression tool |
55 | 57 | ||
56 | The package includes a gxz command line utility for compression and | 58 | The package includes a gxz command line utility for compression and |
57 | decompression. | 59 | decompression. |