<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/til-go-fix-reaches-into-third-party-code-too-mjrzxible" -->

---
title: TIL: go fix Reaches Into Third-Party Code Too | daily.dev
description: Running go fix on Go projects revealed that the tool can automatically rewrite calls into third-party dependencies, not just standard library or own code. The...
canonical: https://daily.dev/posts/til-go-fix-reaches-into-third-party-code-too-mjrzxible
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: TIL: go fix Reaches Into Third-Party Code Too | daily.dev
og:description: Running go fix on Go projects revealed that the tool can automatically rewrite calls into third-party dependencies, not just standard library or own code. The...
og:url: https://daily.dev/posts/til-go-fix-reaches-into-third-party-code-too-mjrzxible
og:image: https://api.daily.dev/og/posts/MJRzXible.png
og:image:alt: TIL: go fix Reaches Into Third-Party Code Too
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TIL: go fix Reaches Into Third-Party Code Too

**[Preslav Rachev](https://daily.dev/sources/preslav-rachev)** · 2 min read · 15 upvotes · 0 comments

## Summary

Running go fix on Go projects revealed that the tool can automatically rewrite calls into third-party dependencies, not just standard library or own code. The author discovered this when go fix changed tint.NewHandler to tint.NewTextHandler across their code. The mechanism is a //go:fix inline directive that library authors can attach to a deprecated function, letting go fix machine-rewrite every call site across the dependency graph.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://preslav.me/2026/09/19/go-fix-inline>

## Questions this post answers

### Can go fix rewrite calls into third-party Go dependencies, not just my own code or the standard library?

Yes, go fix can rewrite calls into third-party dependencies if the library author opts in. A package author adds a //go:fix inline directive alongside a deprecated function, and go fix reads it to automatically rewrite every call site across the dependency graph. For example, the tint logging library marked NewHandler as deprecated in favor of NewTextHandler using this directive, and running go fix ./... automatically changed calls from NewHandler to NewTextHandler in a downstream project.

_daily.dev helps go developers spot tooling changes like go:fix inline before they surprise a build._

### How does the //go:fix inline directive work for deprecating a Go function?

A library author places the //go:fix inline comment directly above a deprecated function's definition, alongside a standard 'Deprecated:' comment pointing to the replacement. When go fix runs across a project, it detects this directive in the dependency's source and rewrites all call sites in the consuming code to use the new function instead, effectively automating the migration described in the deprecation notice.

_track evolving go tooling conventions like this on daily.dev before they change your dependency workflow._

## Similar posts on daily.dev

- [Using go fix to modernize Go code](https://daily.dev/posts/using-go-fix-to-modernize-go-code-minrxyefk) · Go · 145 upvotes · 3 comments
- [Dust Off Your Toolchain: Why go fix is the Secret Star of Go 1.26](https://daily.dev/posts/dust-off-your-toolchain-why-go-fix-is-the-secret-star-of-go-1-26-daxedo5kx) · Medium · 2 upvotes · 0 comments
- [Automating Technical Debt: Code-Level Migrations with 'go fix' 1.30](https://daily.dev/posts/automating-technical-debt-code-level-migrations-with-go-fix-1-30-cjhfkvaoo) · SitePoint · 0 upvotes · 0 comments
- [Go feature: Modernized go fix](https://daily.dev/posts/go-feature-modernized-go-fix-09pkq2pbr) · Anton Zhiyanov · 47 upvotes · 0 comments
- [Go 1.26 Quietly Fixed the Things That Were Actually Annoying](https://daily.dev/posts/go-1-26-quietly-fixed-the-things-that-were-actually-annoying-eei6x0bgf) · Towards Dev · 105 upvotes · 0 comments

---

Tags: [#golang](https://daily.dev/tags/golang)

[View this post on daily.dev](https://daily.dev/posts/til-go-fix-reaches-into-third-party-code-too-mjrzxible)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"TIL: go fix Reaches Into Third-Party Code Too","url":"https://daily.dev/posts/til-go-fix-reaches-into-third-party-code-too-mjrzxible","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/til-go-fix-reaches-into-third-party-code-too-mjrzxible"},"datePublished":"2026-09-19T15:24:52.082Z","dateModified":"2026-09-19T15:25:11.114Z","description":"Running go fix on Go projects revealed that the tool can automatically rewrite calls into third-party dependencies, not just standard library or own code. The...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/86ed247d170bd22a3f8320dd5ae3e620?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/86ed247d170bd22a3f8320dd5ae3e620?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Preslav Rachev","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Preslav Rachev","logo":"https://media.daily.dev/image/upload/s--2e2jzT7b--/f_auto,q_auto/v1780213591/logos/preslav-rachev?_a=BAMAMiWQ0","url":"https://daily.dev/sources/preslav-rachev"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/til-go-fix-reaches-into-third-party-code-too-mjrzxible","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":15},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"golang","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Preslav Rachev","item":"https://daily.dev/sources/preslav-rachev"},{"@type":"ListItem","position":3,"name":"TIL: go fix Reaches Into Third-Party Code Too"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/til-go-fix-reaches-into-third-party-code-too-mjrzxible#faq","mainEntity":[{"@type":"Question","name":"Can go fix rewrite calls into third-party Go dependencies, not just my own code or the standard library?","acceptedAnswer":{"@type":"Answer","text":"Yes, go fix can rewrite calls into third-party dependencies if the library author opts in. A package author adds a //go:fix inline directive alongside a deprecated function, and go fix reads it to automatically rewrite every call site across the dependency graph. For example, the tint logging library marked NewHandler as deprecated in favor of NewTextHandler using this directive, and running go fix ./... automatically changed calls from NewHandler to NewTextHandler in a downstream project. daily.dev helps go developers spot tooling changes like go:fix inline before they surprise a build."}},{"@type":"Question","name":"How does the //go:fix inline directive work for deprecating a Go function?","acceptedAnswer":{"@type":"Answer","text":"A library author places the //go:fix inline comment directly above a deprecated function's definition, alongside a standard 'Deprecated:' comment pointing to the replacement. When go fix runs across a project, it detects this directive in the dependency's source and rewrites all call sites in the consuming code to use the new function instead, effectively automating the migration described in the deprecation notice. track evolving go tooling conventions like this on daily.dev before they change your dependency workflow."}}]}
```

