Go Common pack

Source: Internet
Author: User

The standard go code base contains a large number of packages, and most will be installed with the go. Browsing the $GOROOT/src/pkg directory and viewing those packages can be very enlightening.

FMT: Package FMT implements formatted I/O functions, similar to C's printf and scanf. The formatted phrase is derived from C. Some phrases (%-sequences) are used like this:

%V: The default format value. When the structure is printed, the plus sign (%+V) increases the field name; % #v

Go-style value expression; %T

A value expression with a type of Go style; A describes the Go doc from the package. Additional explanations are used in italics.

This package provides the original I/O operation interface. Its main task is to encapsulate the original I/O packages such as the OS package, adding some other correlation so that it has abstract functionality for use on public interfaces.

This package implements buffered I/O. It is encapsulated in IO. Reader and IO. Writer object, creating another object (Reader and writer) that provides buffering while implementing some textual I/O functionality.

Io

Bufio

Sort: Provides the original sorting functionality for arrays and user-defined collections.

StrConv: Provides the ability to convert a string to a base data type, or to a string from a base data type.

OS: Provides interface to platform-independent operating system functions. Its design is in the form of Unix.

Sync: Provides a basic synchronization primitive, such as a mutex.

Flag: Command-line parsing is implemented. See "Command-Line Arguments" on page 91st.

Encoding/json: Encoding and decoding are implemented.

Text/template: A data-driven template for generating text output, such as HTML. The template is associated to a data structure for parsing. The template content points to the elements of the data structure (usually the fields of the structure or the keys of the map) to control the parsing and determine that a value is displayed. Mode

The board scans the structure for parsing, and the "cursor" @ determines the value of the current position in the structure.

Net/http: Resolves HTTP requests, responses, and URLs, and provides extensible HTTP service and basic HTTP client.

Unsafe: Contains all unsafe operations on the data type in the Go program. This is not usually necessary.

Reflect: Implements run-time reflection, allowing the program to manipulate objects through abstract types. Typically used to handle the value of a static type interface{}, and its dynamic type information is resolved through Typeof, and typically returns an object with the type of interface.

Os/exec: Executes the external command.

Go Common pack

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.