V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zeroday
V2EX  ›  问与答

关于 Golang 函数的声明的疑问

  •  
  •   zeroday · 2015-09-06 15:43:26 +08:00 · 1447 次点击
    这是一个创建于 3170 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在一个 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 条回复    2015-09-06 15:56:28 +08:00
    justfly
        1
    justfly  
       2015-09-06 15:51:41 +08:00   ❤️ 1
    表示 是 influxdbStorage 这个 struct 的方法
    zeroday
        2
    zeroday  
    OP
       2015-09-06 15:56:28 +08:00
    @justfly 明白了,这里定义了 influxdbStorage 的一个方式 getSeriesDefaultValues.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1124 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 18:51 · PVG 02:51 · LAX 11:51 · JFK 14:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.