Skip to content

Commit

Permalink
internal/json: vendor github.com/go-experiment-json/json
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <[email protected]>
  • Loading branch information
hdonnay committed Apr 10, 2024
1 parent 2058231 commit d74fb15
Show file tree
Hide file tree
Showing 8 changed files with 10,545 additions and 0 deletions.
5,077 changes: 5,077 additions & 0 deletions internal/json/bundle.go

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions internal/json/bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
# Bundle the go-json-experiment package(s)
set -e
find . -name bundle.go -delete

upstream='github.com/go-json-experiment'
root="$(go list -m)/internal"
pkglist='json/internal/jsonflags json/internal/jsonopts json/internal/jsonwire json/internal json/jsontext json'
for pkg in $pkglist; do
maparg="${maparg}${maparg+ }-import=${upstream}/${pkg}=${root}/${pkg}"
done

for pkg in $pkglist; do
dir=$(echo "$pkg" | sed 's,^json,.,')
mkdir -p "$dir"
echo "package $(basename "$pkg")" > "${dir}/temp.go"
eval "go run golang.org/x/tools/cmd/bundle -prefix '' $maparg -dst ${root}/${pkg} ${upstream}/${pkg} > _bundle.go"
mv _bundle.go "${dir}/bundle.go"
done

find . -name temp.go -delete
3 changes: 3 additions & 0 deletions internal/json/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package json

//go:generate sh bundle.sh
15 changes: 15 additions & 0 deletions internal/json/internal/bundle.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

187 changes: 187 additions & 0 deletions internal/json/internal/jsonflags/bundle.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d74fb15

Please sign in to comment.