github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/text/encoding/ianaindex/example_test.go (about) 1 // Copyright 2015 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package ianaindex_test 6 7 import ( 8 "fmt" 9 10 "golang.org/x/text/encoding/charmap" 11 "golang.org/x/text/encoding/ianaindex" 12 ) 13 14 func ExampleIndex() { 15 fmt.Println(ianaindex.MIME.Name(charmap.ISO8859_7)) 16 17 fmt.Println(ianaindex.IANA.Name(charmap.ISO8859_7)) 18 19 e, _ := ianaindex.IANA.Get("cp437") 20 fmt.Println(ianaindex.IANA.Name(e)) 21 22 // TODO: Output: 23 // ISO-8859-7 24 // ISO8859_7:1987 25 // IBM437 26 }