1{ lib
2, buildGoModule
3, fetchFromGitHub
4}:
5
6buildGoModule rec {
7 pname = "doc2go";
8 version = "0.5.0";
9
10 src = fetchFromGitHub {
11 owner = "abhinav";
12 repo = "doc2go";
13 rev = "v${version}";
14 hash = "sha256-CFqr1laPxKNhaluGmwW7apxLQqkAFKVznDKezH8gjx0=";
15 };
16 vendorHash = "sha256-2WvlH69iYqIA3d9aFVec8TZL+pMJItoNKSoDBL/NNyg=";
17
18 ldflags = [ "-s" "-w" "-X main._version=${version}" ];
19
20 subPackages = [ "." ];
21
22 checkFlags = [
23 # needs to fetch additional go modules
24 "-skip=TestFinder_ImportedPackage/Modules"
25 ];
26
27 preCheck = ''
28 # run all tests
29 unset subPackages
30 '';
31
32 meta = with lib; {
33 homepage = "https://github.com/abhinav/doc2go";
34 changelog = "https://github.com/abhinav/doc2go/blob/${src.rev}/CHANGELOG.md";
35 description = "Your Go project's documentation, to-go";
36 longDescription = ''
37 doc2go is a command line tool that generates static HTML documentation
38 from your Go code. It is a self-hosted static alternative to
39 https://pkg.go.dev/ and https://godocs.io/.
40 '';
41 license = with licenses; [
42 # general project license
43 asl20
44 # internal/godoc/synopsis*.go adapted from golang source
45 bsd3
46 ];
47 maintainers = with maintainers; [ jk ];
48 };
49}