Skip to content

Instantly share code, notes, and snippets.

View ardnew's full-sized avatar
🤕
cracking skulls

ardnew

🤕
cracking skulls
View GitHub Profile
@ardnew
ardnew / go-mod-local
Created October 29, 2022 09:23
Shell script to add go.mod replace directives when working with multiple local modules
#!/bin/bash
usage() {
cat <<__usage__
-- DESCRIPTION -----------------------------------------------------------------
Insert a 'replace' directive into each given Go module (default: PWD) that
defines a local file path of a Go package to import instead of the published
package named in any of the given modules' import lists.