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 e46c192
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 4 deletions.
83 changes: 83 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.

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

set -e

thriftgo -g fastgo:no_default_serdes=true -o=.. ./base.thrift
thriftgo -g fastgo:no_default_serdes=true,gen_setter=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 '/func.* IsSet.* {/,/^}/d' base_tmp.go |\
sed '/DEFAULT.*{/,/^}/d' |\
sed '/DEFAULT/d' > base.go

Expand Down

0 comments on commit e46c192

Please sign in to comment.