Go报错 : syntax error: unexpected string, expecting comma or )
2017-09-19 15:04
2266 查看
首先肯定是语法错误的,以下为我遇到的情况:
通道定义错误
make()中msg的位置并不是形参,而是类型定义,应使用chan string表示是字符串类型的通道创建。即:
通道定义错误
msgChannel := make(msg string) go func() { msgChannel <- "rungolf" }() message := <-msgChannel fmt.Println(message)
make()中msg的位置并不是形参,而是类型定义,应使用chan string表示是字符串类型的通道创建。即:
msgChannel := make(chan string)
相关文章推荐
- Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable
- syntax error, unexpected ''&expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NU
- 执行显示客户下拉列表时出现:syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
- PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
- ModelSim错误:syntax error, unexpected "IDENTIFIER", expecting ".*" or '.'
- Laravel 报错 :Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING)
- thinkphp syntax error, unexpected ')', expecting T_VARIABLE or '$'
- rickyyu学FPGA——modelsim 仿真错误:【near ";": syntax error, unexpected ';', expecting "STRING_LITERAL"】
- PHP错误 。Parse error: syntax error, unexpected T_INLINE_HTML, expecting T_ENDSWITCH or T_CASE or T_DEFAULT
- RMAN-01009: syntax error: found “dot”: expecting one of: “double-quoted-string, equal, identifier, s
- linux下安装zookeeper报错Syntax error: "(" unexpected (expecting "fi")
- 如何在android中利用NDK编译引入ffmpeg--- Syntax error: word unexpected (expecting ")")
- 执行脚本是报错./cross.install: 25: Syntax error: "do" unexpected (expecting "fi")
- sh: syntax error: word unexpected (expecting ")") 错误
- 可执行程序无法在Linux上运行,显示line 1: syntax error: word unexpected (expecting ")
- Expecting a string, date or number here, Expression x is instead a freemarker.ext.beans.BooleanModel
- /bin/helloworld: line 1: syntax error: unexpected word (expecting ")")
- Ubuntu zookeeper-3.5.0-alpha启动错误 zkEnv.sh: Syntax error: "(" unexpected (expecting "fi")(转)
- 【已解决】可执行程序无法在Linux上运行,显示line 1: syntax error: word unexpected (expecting ")
- Syntax error : end of file unexpected (expecting “then”)