Skip to content

Commit

Permalink
docs: change deprecated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ycydsxy committed Oct 19, 2023
1 parent 01cec8f commit 5d130a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mock_sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package mockey
import "github.com/bytedance/mockey/internal/tool"

type SequenceOpt interface {
// make sure it is mockey private interface
// Private make sure it is mockey private interface
Private
// GetNext is used by mockey, don't use it if you don't know what it does
GetNext() []interface{}
Expand Down
9 changes: 4 additions & 5 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ func getFieldMethod(instance interface{}, fieldName string) (interface{}, bool)
return carrier.Interface(), true
}

// GetPrivateMethod ...
// Deprecated, use GetMethod instead.
// GetPrivateMethod resolve a certain public method from an instance.
// Deprecated, this is an old API in mockito. Please use GetMethod instead.
func GetPrivateMethod(instance interface{}, methodName string) interface{} {
m, ok := reflect.TypeOf(instance).MethodByName(methodName)
if ok {
Expand All @@ -86,7 +86,7 @@ func GetPrivateMethod(instance interface{}, methodName string) interface{} {

// GetNestedMethod resolves a certain public method in anonymous structs, it will
// look for the specific method in every anonymous struct field recursively.
// Deprecated, use GetMethod instead.
// Deprecated, this is an old API in mockito. Please use GetMethod instead.
func GetNestedMethod(instance interface{}, methodName string) interface{} {
if typ := reflect.TypeOf(instance); typ != nil {
if m, ok := getNestedMethod(reflect.ValueOf(instance), methodName); ok {
Expand Down Expand Up @@ -127,8 +127,7 @@ func getNestedMethod(val reflect.Value, methodName string) (reflect.Method, bool
return reflect.PtrTo(typ).MethodByName(methodName)
}

// GetGoroutineId ...
// Deprecated
// GetGoroutineId gets the current goroutine ID
func GetGoroutineId() int64 {
return tool.GetGoroutineID()
}

0 comments on commit 5d130a1

Please sign in to comment.