Go文档支持

Go文档查看帮助很方便,主要可以通过以下两种方式查看

第一种,Go本地运行(参考:#Go语言安装#)起来后,References下面:

  • Package

    Go标准函数库说明。

  • Command

    Go工具说明。

  • Language Specification

    Go官方语言规范说明。

第二种,命令行中执行查看,如

  • godoc image NewRGBA

    文档说明 image.NewRGBA()函数功能,输出结果如下:

     

    PACKAGE

    package image
        import "image"


    TYPES

    type RGBA struct {
        // Pix holds the image's pixels, in R, G, B, A order. The pixel at
        // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4].
        Pix []uint8
        // Stride is the Pix stride (in bytes) between vertically adjacent pixels.
        Stride int
        // Rect is the image's bounds.
        Rect Rectangle
    }
        RGBA is an in-memory image whose At method returns color.RGBA values.

    func NewRGBA(r Rectangle) *RGBA
        NewRGBA returns a new RGBA with the given bounds.


    SUBDIRECTORIES

            color
            draw
            gif
            jpeg
            png

     

  • godoc image/png

    输出整个 image/png包,输出结果如下:

     

    PACKAGE

    package png
        import "image/png"

        Package png implements a PNG image decoder and encoder.

        The PNG specification is at http://www.w3.org/TR/PNG/.

    FUNCTIONS

    func Decode(r io.Reader) (image.Image, error)
        Decode reads a PNG image from r and returns it as an image.Image. The
        type of Image returned depends on the PNG contents.

    func DecodeConfig(r io.Reader) (image.Config, error)
        DecodeConfig returns the color model and dimensions of a PNG image
        without decoding the entire image.

    func Encode(w io.Writer, m image.Image) error
        Encode writes the Image m to w in PNG format. Any Image may be encoded,
        but images that are not image.NRGBA might be encoded lossily.


    TYPES

    type FormatError string
        A FormatError reports that the input is not a valid PNG.

    func (e FormatError) Error() string

    type UnsupportedError string
        An UnsupportedError reports that the input uses a valid but
        unimplemented PNG feature.

    func (e UnsupportedError) Error() string

转载于:https://my.oschina.net/u/724854/blog/111411

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值