Text file src/cmd/go/testdata/script/get_brace.txt

     1  env GO111MODULE=off
     2  
     3  [!exec:git] skip
     4  
     5  # Set up some empty repositories.
     6  cd $WORK/_origin/foo
     7  exec git init
     8  exec git config user.name 'Nameless Gopher'
     9  exec git config user.email 'nobody@golang.org'
    10  exec git commit --allow-empty -m 'create master branch'
    11  
    12  cd $WORK
    13  cd '_origin/{confusing}'
    14  exec git init
    15  exec git config user.name 'Nameless Gopher'
    16  exec git config user.email 'nobody@golang.org'
    17  exec git commit --allow-empty -m 'create master branch'
    18  
    19  # Clone the empty repositories into GOPATH.
    20  # This tells the Go command where to find them: it takes the place of a user's meta-tag redirector.
    21  mkdir $GOPATH/src/example.com
    22  cd $GOPATH/src/example.com
    23  exec git clone $WORK/_origin/foo
    24  exec git clone $WORK/_origin/{confusing}
    25  
    26  # Commit contents to the repositories.
    27  cd $WORK/_origin/foo
    28  exec git add main.go
    29  exec git commit -m 'add main'
    30  
    31  cd $WORK
    32  cd '_origin/{confusing}'
    33  exec git add confusing.go
    34  exec git commit -m 'just try to delete this!'
    35  
    36  # 'go get' should refuse to download or update the confusingly-named repo.
    37  cd $GOPATH/src/example.com/foo
    38  ! go get -u 'example.com/{confusing}'
    39  stderr 'invalid char'
    40  ! go get -u example.com/foo
    41  stderr 'invalid import path'
    42  ! exists example.com/{confusing}
    43  
    44  -- $WORK/_origin/foo/main.go --
    45  package main
    46  import _ "example.com/{confusing}"
    47  
    48  func main() {}
    49  
    50  -- $WORK/_origin/{confusing}/confusing.go --
    51  package confusing
    52  

View as plain text