Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: mod vendor command skip failed dependencies #28447

Closed
chapsuk opened this issue Oct 28, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@chapsuk
Copy link

commented Oct 28, 2018

≻ go version
go version go1.11.1 darwin/amd64
≻ go env
GOARCH="amd64"
GOBIN="/Users/chapsuk/go/bin"
GOCACHE="/Users/chapsuk/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/chapsuk/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/1n/44fppc_x3bg_pbk4cl4gc4wc0000gn/T/go-build389417477=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

  1. Let's imitate connection problems, in real world package source can be unreachable:
echo "127.0.0.1 	mellium.im" >> /etc/hosts
  1. Use sample
package main

import (
	"fmt"
	"mellium.im/sasl"
)

func main() {
	fmt.Printf("%v", sasl.ErrAuthn)
}
  1. Try vendor it
$ env GO111MODULE=on go mod vendor -v
Fetching https://mellium.im/sasl?go-get=1
https fetch failed: Get https://mellium.im/sasl?go-get=1: dial tcp 127.0.0.1:443: connect: connection refused
Fetching https://mellium.im?go-get=1
https fetch failed: Get https://mellium.im?go-get=1: dial tcp 127.0.0.1:443: connect: connection refused
go: no dependencies to vendor

What did you expect to see?

Error result code:

$ echo $?
1

What did you see instead?

Success result code:

$ echo $?
0

@chapsuk chapsuk changed the title Go mod vendor skip failed dependendcies cmd/go: mod vendor command skip failed dependencies Oct 28, 2018

@katiehockman

This comment has been minimized.

Copy link
Contributor

commented Oct 29, 2018

@bcmills bcmills added the modules label Oct 29, 2018

@bcmills bcmills added this to the Go1.12 milestone Oct 29, 2018

@bcmills

This comment has been minimized.

Copy link
Member

commented Nov 16, 2018

Duplicate of #27063.

@bcmills bcmills closed this Nov 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.