+gomarkdoc

This commit is contained in:
Tobias 2024-03-10 10:53:33 +01:00 committed by Jacob Heider
parent 1f791c84ed
commit 822b8b6e19
2 changed files with 53 additions and 0 deletions

View file

@ -0,0 +1,19 @@
// Package example will show you the power of gomarkdoc.
package example
// Example is just magical.
type Example struct {
// Foo is an int.
Foo int
// Bar is a string.
Bar string
}
// New creates an instance of Example with sensible default values.
func New() *Example {
return &Example{
Foo: 42,
Bar: "Baz",
}
}

View file

@ -0,0 +1,34 @@
distributable:
url: https://github.com/princjef/gomarkdoc/archive/refs/tags/v{{version}}.tar.gz
strip-components: 1
display-name: gomarkdoc
versions:
github: princjef/gomarkdoc
strip: /^v/
build:
dependencies:
go.dev: ^1.18
env:
CGO_ENABLED: 0
LDFLAGS:
- -extldflags=-static
- -w
- -s
- -X=main.version=v{{version}}
script:
- go mod download
- go build -ldflags="$LDFLAGS" -o gomarkdoc ./cmd/gomarkdoc
- mkdir -p "{{ prefix }}"/bin
- mv gomarkdoc "{{ prefix }}"/bin
provides:
- bin/gomarkdoc
test:
script:
- test "$(gomarkdoc --version)" = "v{{version}}"
- gomarkdoc -o example.md
- test -f example.md