qiniu / goc

A Comprehensive Coverage Testing System for The Go Programming Language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fatal goc build error : 不支持新版go范型

goushan33 opened this issue · comments

commented

GOC version : V1.4.4

# /internal/util/value.go内容

package util

func IsContainElemInList[T comparable](elem T, list []T) bool {
	for _, i := range list {
		if i == elem {
			return true
		}
	}
	return false
}

error如下:
[2023-03-08T09:16:08.100Z] #12 74.46 time="2023-03-08T17:16:06+08:00" level=fatal msg="cover: /tmp/goc-build-7e1c2e516e84/internal/util/value.go: /tmp/goc-build-7e1c2e516e84/internal/util/value.go:3:25: expected '(', found '['" file="[tool/cover.go:327]"