Skip to content

Commit

Permalink
Merge branch 'master' into openapi-doc-validate
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjashixuan authored Nov 21, 2024
2 parents 55b4207 + 9c8b21a commit 50876b8
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cmd/gf/internal/packed/template-mono-app.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/gf/internal/packed/template-mono.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/gf/internal/packed/template-single.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contrib/registry/zookeeper/zookeeper_registrar.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (r *Registry) Register(_ context.Context, service gsvc.Service) (gsvc.Servi
// Deregister off-lines and removes `service` from the Registry.
func (r *Registry) Deregister(ctx context.Context, service gsvc.Service) error {
ch := make(chan error, 1)
prefix := strings.TrimPrefix(strings.ReplaceAll(service.GetPrefix(), "/", "-"), "-")
prefix := strings.Trim(strings.ReplaceAll(service.GetPrefix(), "/", "-"), "-")
servicePath := path.Join(r.opts.namespace, prefix, service.GetName())
go func() {
err := r.conn.Delete(servicePath, -1)
Expand Down
4 changes: 2 additions & 2 deletions contrib/registry/zookeeper/zookeeper_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (w *watcher) Proceed() ([]gsvc.Service, error) {
}

func (w *watcher) getServicesByPrefix() ([]gsvc.Service, error) {
prefix := strings.TrimPrefix(strings.ReplaceAll(w.prefix, "/", "-"), "-")
prefix := strings.Trim(strings.ReplaceAll(w.prefix, "/", "-"), "-")
serviceNamePath := path.Join(w.nameSpace, prefix)
instances, err, _ := w.group.Do(serviceNamePath, func() (interface{}, error) {
servicesID, _, err := w.conn.Children(serviceNamePath)
Expand Down Expand Up @@ -122,7 +122,7 @@ func (w *watcher) Close() error {
}

func (w *watcher) watch(ctx context.Context) {
prefix := strings.TrimPrefix(strings.ReplaceAll(w.prefix, "/", "-"), "-")
prefix := strings.Trim(strings.ReplaceAll(w.prefix, "/", "-"), "-")
serviceNamePath := path.Join(w.nameSpace, prefix)
for {

Expand Down
4 changes: 0 additions & 4 deletions database/gdb/gdb_core_structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,6 @@ func (c *Core) CheckLocalTypeForField(ctx context.Context, fieldType string, fie
if gstr.ContainsI(fieldType, "unsigned") {
return LocalTypeUint, nil
}
// field length is 1 means boolean.
if typePattern == "1" {
return LocalTypeBool, nil
}
return LocalTypeInt, nil

case
Expand Down
1 change: 0 additions & 1 deletion database/gdb/gdb_model_order_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
//
// Eg:
// Order("id desc")
// Order("id", "desc").
// Order("id desc,name asc")
// Order("id desc").Order("name asc")
// Order(gdb.Raw("field(id, 3,1,2)")).
Expand Down
6 changes: 1 addition & 5 deletions os/gcache/gcache_adapter_memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,7 @@ func (c *AdapterMemory) GetExpire(ctx context.Context, key interface{}) (time.Du
// If multiple keys are given, it returns the value of the last deleted item.
func (c *AdapterMemory) Remove(ctx context.Context, keys ...interface{}) (*gvar.Var, error) {
defer c.lru.Remove(keys...)
value, err := c.doRemove(ctx, keys...)
if err != nil {
return nil, err
}
return gvar.New(value), nil
return c.doRemove(ctx, keys...)
}

func (c *AdapterMemory) doRemove(_ context.Context, keys ...interface{}) (*gvar.Var, error) {
Expand Down

0 comments on commit 50876b8

Please sign in to comment.