tgulacsi/go-bin-update — pull request #1 by rjeczalik (2014-11-01 09:24:23+00:00)
Title: Try to guess import path from main.go file path

The original `go-bin-update` command fails for me with:

```bash
(rjeczalik-macosx) ~ $ go-bin-update
WARN[11-01|09:14:37] Cannot find package for path=/Users/rjeczalik/Workspace/bin/bindata
WARN[11-01|09:14:37] Cannot find package for path=/Users/rjeczalik/Workspace/bin/ciexec
WARN[11-01|09:14:38] Cannot find package for path=/Users/rjeczalik/Workspace/bin/example
WARN[11-01|09:14:40] Cannot find package for path=/Users/rjeczalik/Workspace/bin/examples
WARN[11-01|09:14:40] Cannot find package for path=/Users/rjeczalik/Workspace/bin/fakerpc
WARN[11-01|09:14:41] Cannot find package for path=/Users/rjeczalik/Workspace/bin/go
WARN[11-01|09:14:42] Cannot find package for path=/Users/rjeczalik/Workspace/bin/gobin
WARN[11-01|09:14:43] Cannot find package for path=/Users/rjeczalik/Workspace/bin/gofile
WARN[11-01|09:14:43] Cannot find package for path=/Users/rjeczalik/Workspace/bin/gofmt
WARN[11-01|09:14:44] Cannot find package for path=/Users/rjeczalik/Workspace/bin/google-api-go-generator
WARN[11-01|09:14:44] Cannot find package for path=/Users/rjeczalik/Workspace/bin/gotree
WARN[11-01|09:14:45] Cannot find package for path=/Users/rjeczalik/Workspace/bin/gowhich
WARN[11-01|09:14:45] Cannot find package for path=/Users/rjeczalik/Workspace/bin/pkg-config
WARN[11-01|09:14:46] Cannot find package for path=/Users/rjeczalik/Workspace/bin/ungocheck
```

So I've extended the `scanFile` with one more guessing heuristic, so it works a bit better for my use-case:

```bash
(rjeczalik-macosx) ~ $ go-bin-update
INFO[11-01|10:18:02] go get -u github.com/rjeczalik/bindata/cmd/bindata/
INFO[11-01|10:18:02] go get -u github.com/rjeczalik/ciexec/cmd/ciexec/
INFO[11-01|10:18:03] go get -u code.google.com/p/goauth2/oauth/jwt/example/
INFO[11-01|10:18:04] go get -u code.google.com/p/google-api-go-client/examples/
INFO[11-01|10:18:05] go get -u github.com/rjeczalik/fakerpc/cmd/fakerpc/
INFO[11-01|10:18:05] go get -u cmd/go/
INFO[11-01|10:18:06] go get -u github.com/rjeczalik/bin/cmd/gobin/
INFO[11-01|10:18:06] go get -u github.com/rjeczalik/which/cmd/gofile/
WARN[11-01|10:18:06] Cannot find package for path=/Users/rjeczalik/Workspace/bin/gofmt
WARN[11-01|10:18:07] Cannot find package for path=/Users/rjeczalik/Workspace/bin/google-api-go-generator
INFO[11-01|10:18:08] go get -u github.com/rjeczalik/tools/cmd/gotree/
INFO[11-01|10:18:08] go get -u github.com/rjeczalik/which/cmd/gowhich/
INFO[11-01|10:18:08] go get -u github.com/rjeczalik/pkgconfig/cmd/pkg-config/
INFO[11-01|10:18:09] go get -u github.com/rjeczalik/ungocheck/cmd/ungocheck/
(rjeczalik-macosx) ~ $ go get -u github.com/rjeczalik/bindata/cmd/bindata/
```

This commit contains this one heuristic for guessing function. Plus they are now pluggable, so more can be added.