X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fcoc-go-data%2Ftools%2Fpkg%2Fmod%2Fgolang.org%2Fx%2Ftools%40v0.1.0%2Fgo%2Fanalysis%2Fpasses%2Fstringintconv%2Ftestdata%2Fsrc%2Fa%2Fa.go;fp=.config%2Fcoc%2Fextensions%2Fcoc-go-data%2Ftools%2Fpkg%2Fmod%2Fgolang.org%2Fx%2Ftools%40v0.1.0%2Fgo%2Fanalysis%2Fpasses%2Fstringintconv%2Ftestdata%2Fsrc%2Fa%2Fa.go;h=837469c194335e9aa592090366ddc35026ff0e75;hp=0000000000000000000000000000000000000000;hb=3c06164f15bd10aed7d66b6314764a2961a14762;hpb=0e9c3ceb40901f4d44981c1376cb9e23a248e006 diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.0/go/analysis/passes/stringintconv/testdata/src/a/a.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.0/go/analysis/passes/stringintconv/testdata/src/a/a.go new file mode 100644 index 00000000..837469c1 --- /dev/null +++ b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.0/go/analysis/passes/stringintconv/testdata/src/a/a.go @@ -0,0 +1,36 @@ +// Copyright 2020 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. + +// This file contains tests for the stringintconv checker. + +package a + +type A string + +type B = string + +type C int + +type D = uintptr + +func StringTest() { + var ( + i int + j rune + k byte + l C + m D + n = []int{0, 1, 2} + o struct{ x int } + ) + const p = 0 + _ = string(i) // want `^conversion from int to string yields a string of one rune, not a string of digits \(did you mean fmt\.Sprint\(x\)\?\)$` + _ = string(j) + _ = string(k) + _ = string(p) // want `^conversion from untyped int to string yields a string of one rune, not a string of digits \(did you mean fmt\.Sprint\(x\)\?\)$` + _ = A(l) // want `^conversion from C \(int\) to A \(string\) yields a string of one rune, not a string of digits \(did you mean fmt\.Sprint\(x\)\?\)$` + _ = B(m) // want `^conversion from uintptr to B \(string\) yields a string of one rune, not a string of digits \(did you mean fmt\.Sprint\(x\)\?\)$` + _ = string(n[1]) // want `^conversion from int to string yields a string of one rune, not a string of digits \(did you mean fmt\.Sprint\(x\)\?\)$` + _ = string(o.x) // want `^conversion from int to string yields a string of one rune, not a string of digits \(did you mean fmt\.Sprint\(x\)\?\)$` +}