Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

引入mns包后会屏蔽一些报错 #336

Open
mrold opened this issue Jul 10, 2019 · 1 comment
Open

引入mns包后会屏蔽一些报错 #336

mrold opened this issue Jul 10, 2019 · 1 comment

Comments

@mrold
Copy link

mrold commented Jul 10, 2019

这是我的代码,这里的ch为空,正常情况下执行应该会报错。可是当引入mns包,go run并没有报错,只是阻塞。

package main

import (
	"fmt"
	_ "github.com/denverdino/aliyungo/mns"
)

func main(){
	var ch chan int
	go func() {
		select{
		case x:=<-ch:
			fmt.Println("select", x)
		}
	}()
	ch<-1
}
@zxdyb
Copy link

zxdyb commented Mar 2, 2020

ch 默认值为nil,这样读取通道,默认就是阻塞,不会返回,也不会报错,这和mns包应该没有关系。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants