Go Language Standard library overview

Source: Internet
Author: User

The Go standard library contains a large number of packages, providing a wide range of functional features. This provides an overview that is simply selective and very simple. The content of the standard library may continue to grow after this article is published, so it is advisable to get the latest information through an online lookup library API or use Godoc (included in the Go release package) and to fully understand the capabilities of each package.

The EXP package (experimental) is where the packages that may be added to the standard library in the future start, so you should not use the packages below unless you want to participate in the development of these packages (by testing, discussing, submitting patches). The EXP package usually exists only in the source package that is checked out from the Google Go source tree, but is not generally included in the pre-built package. Other packages can be assured to use, although in the writing of this moment, many packages are still not complete.

Archive (archive) and compression (compressed) packages

Go supports reading and writing tarball and. zip files. The packages associated with this are Archive/tar and Archive/zip, and Compress/gzip and compress/bzip2 for compressing tarball.

Go also supports other compression formats, such as the Lempel-ziv-welch (COMPRESS/LZW) format for TIFF images and PDF files.

Bytes (Byte) and string (string) related packages

Bytes and strings packages have many of the same functions, but the former operates on a value of the]byte type, which operates on a string of values. The strings package provides all the most useful functional functions, such as finding substrings, replacing substrings, splitting strings, culling strings, and capitalization transformations. The StrConv package provides the ability to convert numeric and Boolean types to and from string types.

FMT Bag

Provides a number of useful print and scan functions, which are described in the first and second sections of this series of tutorials.

Unicode Package

Provides functions for determining character attributes, such as determining whether a character is printable, or whether it is a number. Unicode/utf8 and UNICODE/UTF16 These two packages provide the encoding and decoding capabilities of rune (i.e. Unicode code points/characters).

Text/template and Html/template Packs

Can be used to create templates that generate text-form output (such as HTML) based on the data that is filled in. Here is a small and simple example of the use of text/template packages.

1 2 3 4 5 6 7 8 9 10 11 12 13-14 Type Giniindex struct {Country string Index float64} gini: = []giniindex{{"Japan", 54.7}, {"55.0" }, {"U.S.A."
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.