Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 569 Bytes

README.md

File metadata and controls

13 lines (9 loc) · 569 Bytes

Who Dis?

Generate a friendly Git(hub) repository URL for the current file and line number in your Go code. Useful for logs, templates, cron jobs and such, so people can quickly find out where to edit the application. Uses runtime.Caller() and the main module name to guesstimate a repo URL. Currently supports Github but support for other public git services can be easily added.

Usage

import "github.com/gwillem/go-whodis"

// ...

fmt.Println("Generated by", whodis.URL())
// Generated by https://github.com/gwillem/someapp/blob/HEAD/pkg/pkg.go#L11