github.com/wedaly/gospelunk@v0.0.0-20240506220214-89e2d4a79789/README.md (about)

     1  gospelunk
     2  =========
     3  
     4  Go spelunking! CLI tool to quickly find things in Go projects.
     5  
     6  Project Status: Alpha
     7  ---------------------
     8  
     9  -	Things might change
    10  -	Things might break
    11  
    12  Installation
    13  ------------
    14  
    15  Once you have [installed Go](https://go.dev/doc/install), run this:
    16  
    17  ```
    18  go install github.com/wedaly/gospelunk@latest
    19  ```
    20  
    21  Commands
    22  --------
    23  
    24  ### List
    25  
    26  To list definitions in Go packages:
    27  
    28  ```
    29  gospelunk list ./...
    30  ```
    31  
    32  -	You can specify packages using the same format as other go commands. See `go help packages` for details.
    33  -	You can use the `--template` parameter to customize the Go template used to render the output.
    34  -	Use `--include-private` to include non-exported definitions.
    35  -	Use `--include-tests` to include definitions from "_test.go" files.
    36  
    37  ### Inspect
    38  
    39  To lookup type information, definitions, and references for an identifier in a Go file:
    40  
    41  ```
    42  gospelunk inspect -f <FILE> -l <LINE> -c <COLUMN>
    43  ```
    44  
    45  -	Line and column numbers are 1-indexed, and the column unit is bytes.
    46  -	The `--relationKinds` parameter controls which relations are loaded (definitions, references, or implementations).
    47  -	The `--searchDir` parameter controls where gospelunk searches for references and interface implementations.
    48  -	You can use the `--template` parameter to customize the Go template used to render the output.