You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/tmc/misc/auto-fix-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/tmc/misc/auto-fix-go

v0.0.0-20250610033740-47096ee65a06
Source
Go
Version published
Created
Source

auto-fix-go

auto-fix-go is a tool that automatically fixes Go code by running tests, submitting failures and source code to a language model, and making source edits in a loop to drive a program to completion.

Installation

  • Ensure you have Go 1.22 or later installed on your system.

  • Install the tool using go install:

    go install github.com/tmc/misc/auto-fix-go@latest
    

    This will download, compile, and install the auto-fix-go binary in your $GOPATH/bin directory.

  • Make sure your $GOPATH/bin is in your system's PATH.

Usage

Run auto-fix-go by providing the directory containing the Go project you want to fix:

auto-fix-go /path/to/your/go/project

The tool will:

  • Run tests in the specified directory
  • If tests fail, it will submit the source code and test output to a language model
  • Apply the suggested fixes
  • Repeat the process until all tests pass

Requirements

  • Go 1.22 or later
  • An Anthropic API key set in the ANTHROPIC_API_KEY environment variable

Development

If you want to contribute to the project or run it from source:

  • Clone the repository:
    git clone https://github.com/tmc/misc/auto-fix-go.git
    
  • Change to the project directory:
    cd auto-fix-go
    
  • Build the project:
    go build
    

License

This project is licensed under the MIT License. See the LICENSE file for details

FAQs

Package last updated on 10 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts