You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve CWE-665 package initialization - make xurl importable as Go library
Refactor package structure so the module root is an importable library
(package xurl) instead of package main. Moves CLI entrypoint to
cmd/xurl/main.go, updates Makefile and README install paths, and adds
library API surface (NewRootCommand, CreateRootCommand, Execute).
Also includes --app flag credential switching fix with ForApp token
lookups, unconditional WithAppName override, and 18 new tests.
Supersedes closed PR #28 (CLA unsigned by prior contributor).
Resolves CWE-665: improper initialization of resource.
Copy file name to clipboardExpand all lines: README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,23 @@ Installs to `~/.local/bin`. If it's not in your PATH, the script will tell you w
33
33
34
34
### Go
35
35
```bash
36
-
go install github.com/xdevplatform/xurl@latest
36
+
go install github.com/xdevplatform/xurl/cmd/xurl@latest
37
+
```
38
+
39
+
### Use as a Go library
40
+
41
+
Import by module path in other Go projects:
42
+
43
+
```go
44
+
import"github.com/xdevplatform/xurl"
45
+
```
46
+
47
+
If your consuming project uses a local checkout of this repo, you can use a `replace` directive in your `go.mod` while still importing by the full module path:
0 commit comments