Swap interface{} to any

This commit is contained in:
David Dworken 2023-10-07 15:11:49 -07:00
parent d404a73c9b
commit d2788a9f31
No known key found for this signature in database
4 changed files with 5 additions and 5 deletions

View File

@ -33,7 +33,7 @@ func (r *loggingResponseWriter) WriteHeader(statusCode int) {
r.ResponseWriter.WriteHeader(statusCode)
}
func getFunctionName(temp interface{}) string {
func getFunctionName(temp any) string {
strs := strings.Split((runtime.FuncForPC(reflect.ValueOf(temp).Pointer()).Name()), ".")
return strs[len(strs)-1]
}

View File

@ -49,7 +49,7 @@ type CustomColumn struct {
Val string `json:"value"`
}
func (c *CustomColumns) Scan(value interface{}) error {
func (c *CustomColumns) Scan(value any) error {
bytes, ok := value.([]byte)
if !ok {
return fmt.Errorf("failed to unmarshal CustomColumns value %#v", value)

View File

@ -826,12 +826,12 @@ func retryingSearch(ctx context.Context, db *gorm.DB, query string, limit int, c
return historyEntries, nil
}
func parseNonAtomizedToken(token string) (string, interface{}, interface{}, interface{}, error) {
func parseNonAtomizedToken(token string) (string, any, any, any, error) {
wildcardedToken := "%" + unescape(token) + "%"
return "(command LIKE ? OR hostname LIKE ? OR current_working_directory LIKE ?)", wildcardedToken, wildcardedToken, wildcardedToken, nil
}
func parseAtomizedToken(ctx context.Context, token string) (string, interface{}, interface{}, error) {
func parseAtomizedToken(ctx context.Context, token string) (string, any, any, error) {
splitToken := splitEscaped(token, ':', 2)
field := unescape(splitToken[0])
val := unescape(splitToken[1])

View File

@ -91,7 +91,7 @@ type MessageIdentifier struct {
EntryId string `json:"entry_id"`
}
func (m *MessageIdentifiers) Scan(value interface{}) error {
func (m *MessageIdentifiers) Scan(value any) error {
bytes, ok := value.([]byte)
if !ok {
return fmt.Errorf("failed to unmarshal JSONB value: %v", value)