> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# timakin/go-module

CircleCI orb for Go Modules.
https://github.com/timakin/circleci-orbs


## Commands

### download

Run `go mod download` using cache


| Parameter | Type | Default | Description |
|---|---|---|---|
| `attach-workspace` | boolean | false | Boolean for whether or not to attach to an existing workspace. Default is false.
 |
| `checkout` | boolean | true | Boolean for whether or not to checkout as a first step. Default is true.
 |
| `persist-to-workspace` | boolean | false | Boolean for whether or not to persist to a workspace. Default is false.
 |
| `project_name` | string | go-mod-cache | Built project name |
| `vendoring` | boolean | false | Boolean for whether or not to run `go mod vendor`. Default is false.
 |
| `working-directory` | string | . | directory path for this job |
| `workspace-root` | string | . | Workspace root path that is either an absolute path or a path relative to the working directory. Defaults to '.' (the working directory)
 |

## Jobs

### download

Download Go packages referenced from your project. Using cache, CircleCI will run `go mod download` as efficient as it could.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `attach-workspace` | boolean | false | Boolean for whether or not to attach to an existing workspace. Default is false.
 |
| `checkout` | boolean | true | Boolean for whether or not to checkout as a first step. Default is true.
 |
| `executor` | executor | default | executor to use for this job |
| `persist-to-workspace` | boolean | false | Boolean for whether or not to persist to a workspace. Default is false.
 |
| `project_name` | string | go-mod-cache | Built project name |
| `vendoring` | boolean | false | Boolean for whether or not to run `go mod vendor`. Default is false.
 |
| `working-directory` | string | . | directory path for this job |
| `workspace-root` | string | . | Workspace root path that is either an absolute path or a path relative to the working directory. Defaults to '.' (the working directory)
 |

## Examples

### go-module

Run `go mod download` using cache


```yaml
executors:
  golang:
    docker:
      - image: circleci/golang:1.11.1-stretch
orbs:
  go-module: timakin/go-module@volatile
version: 2.1
workflows:
  build:
    jobs:
      - go-module/download:
          attach-workspace: true
          checkout: true
          executor: golang
          persist-to-workspace: true
          project_name: sample_project
          vendoring: false
          working-directory: server
          workspace-root: /go/src/github.com/timakin/sample_project
```