Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed May 6, 2024
1 parent 05768d8 commit 407c1a2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion codegen/fieldmask/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func init() {
// new a obj to get its TypeDescriptor
obj := nbase.NewBase()

// construct a fieldmask with TypeDescriptor and thrift pathes
// construct a fieldmask with TypeDescriptor and thrift paths
fm, err := fieldmask.NewFieldMask(obj.GetTypeDescriptor(),
"$.Enum", "$.EnumMap{1}", "$.LogID", "$.TrafficEnv.Name", "$.TrafficEnv.Code", "$.Meta.IntMap{1}", "$.Meta.StrMap{\"1234\"}",
"$.Meta.List[1]", "$.Meta.Set[0].id", "$.Meta.Set[1].name")
Expand Down
4 changes: 2 additions & 2 deletions thriftrpc/fieldmask/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package main
package fieldmask

import (
"context"
Expand All @@ -27,7 +27,7 @@ type BizServiceImpl struct{}

// BizMethod1 implements the BizServiceImpl interface.
func (s *BizServiceImpl) BizMethod1(ctx context.Context, req *fieldmask0.BizRequest) (resp *fieldmask0.BizResponse, err error) {
// check if reques has been masked
// check if request has been masked
if req.A != "" { // req.A must be filtered
return nil, errors.New("request must filter BizRequest.A!")
}
Expand Down
4 changes: 2 additions & 2 deletions thriftrpc/fieldmask/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package main
package fieldmask

import (
"context"
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestFieldMask(t *testing.T) {
req.Set_FieldMask(reqMask.(*fieldmask.FieldMask))
}

// try get reponse's fieldmask
// try get response's fieldmask
respMask, ok := fmCache.Load("BizResponse")
if ok {
// serialize the respMask
Expand Down

0 comments on commit 407c1a2

Please sign in to comment.