phgasil.blogg.se

Go installpkg
Go installpkg










go installpkg
  1. #GO INSTALLPKG INSTALL#
  2. #GO INSTALLPKG MOD#
  3. #GO INSTALLPKG DOWNLOAD#

  • Note: 'go install pkg' is not equivalent to 'go install to avoid the ambiguity we have today with 'go get'.
  • If GO111MODULE=on, then 'go install pkg' will report an error.
  • 'go install pkg' outside of a module would run in GOPATH mode by default.
  • This is close to the current behavior, except that -mod=readonly would be the default.

    go installpkg

    If no required module provides pkg, an error would be reported. 'go install pkg' within a module would install pkg at the version required in the module's go.mod.There are several more restrictions: all arguments must refer to packages in the same module at the same version, and its go.mod must not contain replace directives or anything else that would cause it to be interpreted differently than if it were the main module.I've updated that proposal to use 'go install', and added examples and rationale. This takes the place of 'go get -b' in #40276.It would always run in module or would report an error if GO111MODULE=off. It would ignore the go.mod in the current directory, if there is one. 'go install would install pkg at version.It must not contain directives that would cause It to be interpreted differently than if it were the main module.

    go installpkg

    #GO INSTALLPKG MOD#

    mod file for the module providing named packages contains one or # 'go install succeeds when -mod=readonly is set explicitly. com / cmd / version - m $GOPATH / bin / a$GOEXE Go list - m - versions - retracted example. # 'go install will only match a retracted version if it's Stderr '^go install version constraints requires but is requested$' # 'go install should report an error if the module requires a # 'go install should report errors if the module contains Stderr '^go: warning: "/cmd/err\.\.\." matched no main packages$' # If a wildcard matches only non-main packges, we should see a different warning. Stderr '^go: warning: "/cmd/nomatch\.\.\." matched no packages$' Stderr '^go install module found, but does not contain packages matching /cmd/nomatch\.\.\.$' # If a wildcard matches no packages, we should see a warning. Links from html files containing documentation to documentation in another package not yet installed may go to the wrong place, because it is assumed that. Stderr 'errerr.go:3:9: undefined: DoesNotCompile$' # with an error, so we'll know if that gets built. # Wildcards should match only main packages. Stderr '^go install: package /cmd/err is not a main package$' Stderr '^go install: package rsc.io/fortune provided by module packages must be provided by the same module 'go install should report an error if an argument is not com / cmd / '^go install all arguments must have the same version 'go install should report an error if the arguments are in # if the version suffixes are different, even if they refer to the same version. Stderr '^go install: package cmd/go not provided by module 'go install should accept multiple arguments but report an error Stderr '^go install ' $WORK argument must be a package path, not an absolute path$' Stderr '^go install argument must be a package path, not a relative path$' com '^go install argument must be a clean package path$' Stderr '^go install argument must not be a package in the standard library$' Stderr '^go install argument must be a package path, not a meta-package$' # 'go install reports errors for meta packages, std packages, Go install - mod = readonly $GOPATH / pkg / mod / rsc.

    #GO INSTALLPKG DOWNLOAD#

    Stderr '^go: missing go.sum entry to add it:\n\tgo mod download rsc.io/fortune$' ! go install - mod = readonly $GOPATH / pkg / mod / rsc. Stderr '^go: cannot find main module see ''go help modules''$' # 'go install works like a normal 'go install' command if Stdout '^\tdep\trsc.io/quote\tv1.5.2\t' # latest version of fortune's dependency Go version - m $GOPATH / bin / fortune$GOEXE Stderr '^go: found rsc.io/quote in rsc.io/quote v1.5.2$' # With a proxy, the two cases are indistinguishable. # and with a module whose go.mod file has missing requirements. # 'go install works on a module that doesn't have a go.mod file # Every test case requires linking, so we only cover the most important cases com / cmd / '^go: -modfile cannot be used with commands that ignore the current module$' # -modfile is specified explicitly on the command line. # 'go install -modfile=x.mod reports an error, but only if Stdout '^\tmod\/cmd\tv1.0.0\t' # "latest", not from go.mod Stderr '^go: missing go.sum entry to add it:\n\tgo mod download /cmd$' # 'go install ignores go.mod in current directory. Stderr '^go: modules disabled by GO111MODULE=off see ''go help modules''$' # 'go install reports an error if modules are disabled.












    Go installpkg