go issue9083 源码

  • 2022-07-15
  • 浏览 (840)

golang issue9083 代码

文件路径:/test/fixedbugs/issue9083.go

// errorcheck

// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Issue 9083: map/chan error messages show non-explicit capacity.

package main

// untyped constant
const zero = 0

func main() {
	var x int
	x = make(map[int]int)       // ERROR "cannot use make\(map\[int\]int\)|incompatible"
	x = make(map[int]int, 0)    // ERROR "cannot use make\(map\[int\]int, 0\)|incompatible"
	x = make(map[int]int, zero) // ERROR "cannot use make\(map\[int\]int, zero\)|incompatible"
	x = make(chan int)          // ERROR "cannot use make\(chan int\)|incompatible"
	x = make(chan int, 0)       // ERROR "cannot use make\(chan int, 0\)|incompatible"
	x = make(chan int, zero)    // ERROR "cannot use make\(chan int, zero\)|incompatible"
}

相关信息

go 源码目录

相关文章

go bug000 源码

go bug002 源码

go bug003 源码

go bug004 源码

go bug005 源码

go bug006 源码

go bug007 源码

go bug008 源码

go bug009 源码

go bug010 源码

0  赞