mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-25 09:43:20 +01:00
Swap interface{} to any
This commit is contained in:
parent
d404a73c9b
commit
d2788a9f31
@ -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]
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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])
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user