Bug 200209 - lang/go: "go tool vet" doesn't work
Summary: lang/go: "go tool vet" doesn't work
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Julien Laffaye
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-14 20:16 UTC by Anis Elleuch
Modified: 2016-05-12 14:23 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (jlaffaye)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anis Elleuch 2015-05-14 20:16:48 UTC
Overview:
========

go tool vet doesn't work though it should be according to the README of https://github.com/golang/tools

Steps to Reproduce:
==================

Execute "go tool vet"

Actual Results:
==============

go tool: no such tool "vet"; to install:
        go get golang.org/x/tools/cmd/vet


Expected Results: 
================

Usage of vet:
        vet [flags] directory...
        vet [flags] files... # Must be a single package
For more information run
        godoc golang.org/x/tools/cmd/vet

Flags:
  -all=true: check everything; disabled if any explicit check is requested
  -asmdecl=unset: check assembly against Go declarations

....
....


Build Date & Hardware: 
=====================

The last version of golang under FreeBSD 10.1-RELEASE-p10 amd64
Comment 1 Anis Elleuch 2015-05-14 20:44:04 UTC
(In reply to Anis Elleuch from comment #0)

$ go version
go version go1.4.2 freebsd/amd64
Comment 2 Julien Laffaye freebsd_committer freebsd_triage 2015-05-14 21:32:52 UTC
Tools like godoc and go vet are developped in a separate repository.
You have to intall them via "go get"
Comment 3 Anis Elleuch 2015-05-14 21:37:47 UTC
$ go get golang.org/x/tools/cmd/vet
go install golang.org/x/tools/cmd/vet: open /usr/local/go/pkg/tool/freebsd_amd64/vet: permission denied

it seems that installing vet via "go get" needs root access..
Comment 4 Frederick F. Kautz IV 2015-05-16 00:36:54 UTC
There are three tools included in the latest official linux distribution (currently 1.4.2) that are missing from the FreeBSD ports version:

cover
tour
vet

I believe installing each of these requires write access to /usr/local. Can't test atm since install is currently broken from a missing upstream dep. I'll confirm later and respond.
Comment 5 Frederick F. Kautz IV 2015-05-16 00:58:54 UTC
Here is some more info:

vet and cover both require root (or GOROOT) access.

tour can be installed without root via:

go get golang.org/x/tour/gotour

Tour probably has limited utility since there is an online version accessible via https://tour.golang.org/welcome/1. However, cover and vet are both very useful and should probably be installed by default.
Comment 6 Steven Hartland freebsd_committer freebsd_triage 2016-05-12 14:23:53 UTC
This works as expected in later versions of go so closing.