zeroday
V2EX  ›  问与答

关于 Golang 函数的声明的疑问

  •  
  •   zeroday · Sep 6, 2015 · 1805 views
    This topic created in 3902 days ago, the information mentioned may be changed or developed.

    在一个 Go 项目看到这么一个声明,不是很理解某个部分的含义,还请大家解惑了。

    func (self *influxdbStorage ) getSeriesDefaultValues (
        ref info.ContainerReference,
        stats *info.ContainerStats,
        columns *[]string,
        values *[]interface{}) {
    }
    

    getSeriesDefaultValues 表示函数名
    (
    ref info.ContainerReference,
    stats *info.ContainerStats,
    columns *[]string,
    values *[]interface{})

    表示为参数

    请问 (self *influxdbStorage ) 表示的是什么?

    2 replies    2015-09-06 15:56:28 +08:00
    justfly
        1
    justfly  
       Sep 6, 2015   ❤️ 1
    表示 是 influxdbStorage 这个 struct 的方法
    zeroday
        2
    zeroday  
    OP
       Sep 6, 2015
    @justfly 明白了,这里定义了 influxdbStorage 的一个方式 getSeriesDefaultValues.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1129 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 18:04 · PVG 02:04 · LAX 11:04 · JFK 14:04
    ♥ Do have faith in what you're doing.