Skip to content

Instantly share code, notes, and snippets.

@hymkor
Last active October 28, 2025 05:06
Show Gist options
  • Select an option

  • Save hymkor/af624060b243b74aef5bf563a95a1e96 to your computer and use it in GitHub Desktop.

Select an option

Save hymkor/af624060b243b74aef5bf563a95a1e96 to your computer and use it in GitHub Desktop.
<!-- badges.cmd | -->改行<!-- --> という行を README.md に入れておくと、example-into-readme が Go Test のバッジを埋め込んでくれるバッチファイル(要goawk)
@echo off
if exist ".github\workflows\go.yml" goawk "/^module /{ printf '[![Go Test](https://%%s/actions/workflows/go.yml/badge.svg)](https://%%s/actions/workflows/go.yml)\n',$2,$2 }" go.mod
if exist LICENSE findstr "^MIT License" LICENSE >nul 2>&1 && goawk "/^module /{ printf '[![License](https://img.shields.io/badge/License-MIT-red)](https://%%s/blob/master/LICENSE)\n',$2}" go.mod
goawk "/^module /{ printf '[![Go Reference](https://pkg.go.dev/badge/%%s.svg)](https://pkg.go.dev/%%s)\n',$2,$2}" go.mod
rem gist https://gist.github.com/hymkor/af624060b243b74aef5bf563a95a1e96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment