File: nested.txt

package info (click to toggle)
golang-golang-x-tools 1%3A0.25.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,724 kB
  • sloc: javascript: 2,027; asm: 1,645; sh: 166; yacc: 155; makefile: 49; ansic: 8
file content (72 lines) | stat: -rw-r--r-- 1,310 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
This test checks that gopls works with nested modules, including multiple
nested modules.

-- flags --
-min_go=go1.20

-- main.go --
package main

import "fmt"

func main() {
	fmt.Println(mainMsg) //@def("mainMsg", mainMsg)
	fmt.Println(undef) //@diag("undef", re"undefined|undeclared")
}
-- main2.go --
package main

const mainMsg = "main" //@loc(mainMsg, "mainMsg")

-- mod1/go.mod --
module golang.org/lsptests/mod1

go 1.20

-- mod1/a/a.go --
package a

import (
	"fmt"
	"golang.org/lsptests/mod1/b"
)

func _() {
	fmt.Println(b.Msg) //@def("Msg", Msg)
	fmt.Println(undef) //@diag("undef", re"undefined|undeclared")
}

-- mod1/a/tagged.go --
//go:build tag1

// golang/go#60776: verify that we get an accurate error about build tags
// here, rather than an inaccurate error suggesting to add a go.work
// file (which won't help).
package a //@diag(re`package (a)`, re`excluded due to its build tags`)

-- mod1/b/b.go --
package b

const Msg = "1" //@loc(Msg, "Msg")

-- mod2/go.mod --
module golang.org/lsptests/mod2

require golang.org/lsptests/mod1 v0.0.1

replace golang.org/lsptests/mod1 => ../mod1

go 1.20

-- mod2/c/c.go --
package c

import (
	"fmt"
	"golang.org/lsptests/mod1/b"
)

func _() {
	fmt.Println(b.Msg) //@def("Msg", Msg)
	fmt.Println(undef) //@diag("undef", re"undefined|undeclared")
}