Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7e32318

Browse files
committed
comment generate.sh
1 parent2ef8d8a commit7e32318

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎coderd/database/generate.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,26 @@ sqlc generate
88

99
first=true
1010
forfiin queries/*.sql.go;do
11+
# Find the last line from the imports section and add 1.
1112
cut=$(grep -n')'"$fi"| head -n 1| cut -d: -f1)
1213
cut=$((cut+1))
1314

15+
# Copy the header from the first file only, ignoring the source comment.
1416
if$first;then
1517
head -n 4<"$fi"| grep -v"source"> queries.sql.go
1618
first=false
1719
fi
1820

21+
# Append the file past the imports section into queries.sql.go.
1922
tail -n"+$cut"<"$fi">> queries.sql.go
2023
done
2124

25+
# Remove temporary go files.
2226
rm -f queries/*.go
2327

28+
# Ensure correct imports exist.
2429
goimports -w queries.sql.go
30+
31+
# Fix struct/interface names.
2532
gofmt -w -r'Querier -> querier' --*.go
2633
gofmt -w -r'Queries -> sqlQuerier' --*.go

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp