Go “append()…”在围棋中做什么

Go “append()…”在围棋中做什么,go,Go,我有这个密码 kithttp.NewServer( endpoints.AuthorizeUserEndpoint, decodeRequest, encodeResponse, append(options, httptransport.ServerBefore(opentracing.FromHTTPRequest(tracer, "calling HTTP POST /endpoint", logger)))..., ) 你能解释一下append()…最后

我有这个密码

kithttp.NewServer(
    endpoints.AuthorizeUserEndpoint,
    decodeRequest,
    encodeResponse,
    append(options, httptransport.ServerBefore(opentracing.FromHTTPRequest(tracer, "calling HTTP POST /endpoint", logger)))...,
)
你能解释一下
append()…
最后对
做了什么吗

append内置函数将元素追加到片段的末尾

阅读更多信息

变量函数中使用
(其中
append
是一个示例),以传递前面变量的所有元素

因此,给定一个变量
x:=[]int{1,2,3}
,表达式
foo(x…)
将把它传递给一个函数,就像调用
foo(1,2,3)
而不是
foo(x)
,后者相当于
foo([]int{1,2,3})

append内置函数将元素追加到片段的末尾

阅读更多信息

变量函数中使用
(其中
append
是一个示例),以传递前面变量的所有元素


因此,给定一个变量
x:=[]int{1,2,3}
,表达式
foo(x…)
将把它传递给一个函数,就好像你调用了
foo(1,2,3)
而不是
foo(x)
,后者相当于
foo([]int{1,2,3})
基本上
append
采用
选项
切片,向其附加附加选项,返回新切片,然后此合并切片作为单独参数传递给
kithttp.NewServer
构造函数,这要归功于
..

基本上
append
接受
选项
切片,向其附加附加选项,返回新切片,然后此合并切片作为单独的参数传递给
kithttp.NewServer
构造函数,这要归功于