Use tabs as the canonical source indentation in git
Space conversion is done during generation only. Fixes #192
This commit is contained in:
committed by
Mark McGranaghan
parent
1699ad1c45
commit
7c160440be
@@ -11,27 +11,27 @@ import "fmt"
|
||||
|
||||
func main() {
|
||||
|
||||
// Here's the `string` we'll encode/decode.
|
||||
data := "abc123!?$*&()'-=@~"
|
||||
// Here's the `string` we'll encode/decode.
|
||||
data := "abc123!?$*&()'-=@~"
|
||||
|
||||
// Go supports both standard and URL-compatible
|
||||
// base64. Here's how to encode using the standard
|
||||
// encoder. The encoder requires a `[]byte` so we
|
||||
// convert our `string` to that type.
|
||||
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
|
||||
fmt.Println(sEnc)
|
||||
// Go supports both standard and URL-compatible
|
||||
// base64. Here's how to encode using the standard
|
||||
// encoder. The encoder requires a `[]byte` so we
|
||||
// convert our `string` to that type.
|
||||
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
|
||||
fmt.Println(sEnc)
|
||||
|
||||
// Decoding may return an error, which you can check
|
||||
// if you don't already know the input to be
|
||||
// well-formed.
|
||||
sDec, _ := b64.StdEncoding.DecodeString(sEnc)
|
||||
fmt.Println(string(sDec))
|
||||
fmt.Println()
|
||||
// Decoding may return an error, which you can check
|
||||
// if you don't already know the input to be
|
||||
// well-formed.
|
||||
sDec, _ := b64.StdEncoding.DecodeString(sEnc)
|
||||
fmt.Println(string(sDec))
|
||||
fmt.Println()
|
||||
|
||||
// This encodes/decodes using a URL-compatible base64
|
||||
// format.
|
||||
uEnc := b64.URLEncoding.EncodeToString([]byte(data))
|
||||
fmt.Println(uEnc)
|
||||
uDec, _ := b64.URLEncoding.DecodeString(uEnc)
|
||||
fmt.Println(string(uDec))
|
||||
// This encodes/decodes using a URL-compatible base64
|
||||
// format.
|
||||
uEnc := b64.URLEncoding.EncodeToString([]byte(data))
|
||||
fmt.Println(uEnc)
|
||||
uDec, _ := b64.URLEncoding.DecodeString(uEnc)
|
||||
fmt.Println(string(uDec))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user