<commit_before>## godefinfo - find symbol information in Go source

godefinfo, given a location in a source file, prints information about
the identifier's definition: package import path, parent type name
(for methods and fields), and name.

It is based on rogpeppe's [godef](https://github.com/rogpeppe/godef),
but it uses the Go standard library's `go/types` instead of a custom
variant, and it removes support for acme and the `-a -A -t` flags.<commit_msg>add installation and usage info<commit_after>## godefinfo - find symbol information in Go source

godefinfo, given a location in a source file, prints information about
the identifier's definition: package import path, parent type name
(for methods and fields), and name.

It is based on rogpeppe's [godef](https://github.com/rogpeppe/godef),
but it uses the Go standard library's `go/types` instead of a custom
variant, and it removes support for acme and the `-a -A -t` flags.

### Sample output

For the character offset denoted with the caret:

```
package foo

import "net/http"

func bar() {
	resp, _ := http.Get("http://example.com")
	resp.Body
	     ^
}
```

godefinfo will output:

```
net/http Response Body
```

### Installation

```
go get -u github.com/sqs/godefinfo
```

### Usage

See `godefinfo -h` for more information.

```
# prints information about the identifier at offset 1234
godefinfo -o 1234 -f /path/to/go/file.go
```

## Using in your editor

If you prefer to see godefinfo-style output over godef output

godefinfo is very easy to install (it intentionally has zero
dependencies outside the Go standard library).

```
GOPATH=/tmp/MYTEMPDIR GOBIN=/tmp/MAYBE-A-DIR-IN-YOUR-EDITOR-PLUGIN-DATA-DIR go get -u github.com/sqs/godefinfo
rm -rf /tmp/MYTEMPDIR # no need to keep the source code around
```

Then the godefinfo program will be available at `/tmp/MAYBE-A-DIR-IN-YOUR-EDITOR-PLUGIN-DATA-DIR/godefinfo`.
{'fraction_non_alphanumeric': 0.10406761753829899, 'fraction_numerical': 0.004226096143687269, 'mean_word_length': 4.146739130434782, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6900796', 'n_tokens_mistral': 641, 'n_tokens_neox': 593, 'n_words': 239}