aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/get_brace.txt
blob: 3449a0c2c82995fc54786f672fb2caf1f4a3b8f9 (plain)
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
env GO111MODULE=off

[!exec:git] skip

# Set up some empty repositories.
cd $WORK/_origin/foo
exec git init
exec git config user.name 'Nameless Gopher'
exec git config user.email 'nobody@golang.org'
exec git commit --allow-empty -m 'create master branch'

cd $WORK
cd '_origin/{confusing}'
exec git init
exec git config user.name 'Nameless Gopher'
exec git config user.email 'nobody@golang.org'
exec git commit --allow-empty -m 'create master branch'

# Clone the empty repositories into GOPATH.
# This tells the Go command where to find them: it takes the place of a user's meta-tag redirector.
mkdir $GOPATH/src/example.com
cd $GOPATH/src/example.com
exec git clone $WORK/_origin/foo
exec git clone $WORK/_origin/{confusing}

# Commit contents to the repositories.
cd $WORK/_origin/foo
exec git add main.go
exec git commit -m 'add main'

cd $WORK
cd '_origin/{confusing}'
exec git add confusing.go
exec git commit -m 'just try to delete this!'

# 'go get' should refuse to download or update the confusingly-named repo.
cd $GOPATH/src/example.com/foo
! go get -u 'example.com/{confusing}'
stderr 'invalid char'
! go get -u example.com/foo
stderr 'invalid import path'
! exists example.com/{confusing}

-- $WORK/_origin/foo/main.go --
package main
import _ "example.com/{confusing}"

func main() {}

-- $WORK/_origin/{confusing}/confusing.go --
package confusing