Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Support passing `--srcdir` to goimports

Open
#79 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go, vim
Domain
tooling

Research direction

Start with the gofmt formatter usage described in doc/codefmt.txt and trace how gofmt_executable is invoked. Check the goimports path-inference behavior and the --srcdir option; done means the argument is passed only for goimports, while gofmt continues to run without it.

Written by the indexing model from the issue text.

Description

enhancement

When using goimports via our gofmt formatter as suggested in the docs, the goimports path-based inference doesn't work because we don't tell goimports about the path. It does support a --srcdir argument we could pass.

We'd have to make it conditional and detect basename(gofmt_executable) == 'goimports' or something like that because gofmt doesn't support any --srcdir arg.

Dominant language
Vim Script
Stars
1.1k
Forks
102
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/vim-codefmt

All issues in google/vim-codefmt

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.