File: dynamicports.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 (118 lines) | stat: -rw-r--r-- 2,612 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
This test checks that the zero-config algorithm selects Views to cover first
class ports.

In this test, package a imports b, and b imports c. Package a contains files
constrained by go:build directives, package b contains files constrained by the
GOOS matching their file name, and package c is unconstrained. Various
assertions check that diagnostics and navigation work as expected.

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

-- a/a.go --
package a

import "golang.org/lsptests/b"

var _ = b.F //@loc(F, "F")

-- a/linux64.go --
//go:build (linux && amd64)

package a

import "golang.org/lsptests/b"

var _ int = 1<<32 -1 // OK on 64 bit platforms. Compare linux32.go below.

var (
	_ = b.LinuxOnly   //@def("LinuxOnly", LinuxOnly)
	_ = b.DarwinOnly  //@diag("DarwinOnly", re"(undefined|declared)")
	_ = b.WindowsOnly //@diag("WindowsOnly", re"(undefined|declared)")
)

-- a/linux32.go --
//go:build (linux && 386)

package a

import "golang.org/lsptests/b"

var _ int = 1<<32 -1 //@diag("1<<32", re"overflows")

var (
	_ = b.LinuxOnly   //@def("LinuxOnly", LinuxOnly)
	_ = b.DarwinOnly  //@diag("DarwinOnly", re"(undefined|declared)")
	_ = b.WindowsOnly //@diag("WindowsOnly", re"(undefined|declared)")
)

-- a/darwin64.go --
//go:build (darwin && amd64)

package a

import "golang.org/lsptests/b"

var (
	_ = b.LinuxOnly   //@diag("LinuxOnly", re"(undefined|declared)")
	_ = b.DarwinOnly  //@def("DarwinOnly", DarwinOnly)
	_ = b.WindowsOnly //@diag("WindowsOnly", re"(undefined|declared)")
)

-- a/windows64.go --
//go:build (windows && amd64)

package a

import "golang.org/lsptests/b"

var (
	_ = b.LinuxOnly   //@diag("LinuxOnly", re"(undefined|declared)")
	_ = b.DarwinOnly  //@diag("DarwinOnly", re"(undefined|declared)")
	_ = b.WindowsOnly //@def("WindowsOnly", WindowsOnly)
)

-- b/b_other.go --
//go:build !linux && !darwin && !windows
package b

func F() {}

-- b/b_linux.go --
package b

import "golang.org/lsptests/c"

func F() { //@refs("F", "F", F)
	x := c.Common //@diag("x", re"not used"),def("Common", Common)
}

const LinuxOnly = "darwin" //@loc(LinuxOnly, "LinuxOnly")

-- b/b_darwin.go --
package b

import "golang.org/lsptests/c"

func F() { //@refs("F", "F", F)
	x := c.Common //@diag("x", re"not used"),def("Common", Common)
}

const DarwinOnly = "darwin" //@loc(DarwinOnly, "DarwinOnly")

-- b/b_windows.go --
package b

import "golang.org/lsptests/c"

func F() { //@refs("F", "F", F)
	x := c.Common //@diag("x", re"not used"),def("Common", Common)
}

const WindowsOnly = "windows" //@loc(WindowsOnly, "WindowsOnly")

-- c/c.go --
package c

const Common = 0 //@loc(Common, "Common")