Skip to content

Commit

Permalink
feat(thrift): base get/set for beter compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaost committed Aug 5, 2024
1 parent cf6cf61 commit 85bda18
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 14 deletions.
104 changes: 104 additions & 0 deletions protocol/thrift/base/base.go

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

16 changes: 2 additions & 14 deletions protocol/thrift/base/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@

set -e

thriftgo -g fastgo:no_default_serdes=true -o=.. ./base.thrift

mv base.go base_tmp.go # fix sed base.go > base.go
# rm unused funcs and vars, keep the file smaller:
# func GetXXX
# func IsSet
# multiline DEFAULT vars
# singleline DEFAULT vars
sed '/func.* Get.* {/,/^}/d' base_tmp.go |\
sed '/func.* IsSet.* {/,/^}/d' |\
sed '/DEFAULT.*{/,/^}/d' |\
sed '/DEFAULT/d' > base.go

thriftgo -g fastgo:no_default_serdes=true,gen_setter=true -o=.. ./base.thrift
gofmt -w base.go
rm base_tmp.go
gofmt -w k-base.go

0 comments on commit 85bda18

Please sign in to comment.