mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
18 lines
309 B
Go
18 lines
309 B
Go
package utils
|
|
|
|
import "github.com/crawlab-team/crawlab/core/interfaces"
|
|
|
|
func GetUserFromArgs(args ...interface{}) (u interfaces.User) {
|
|
for _, arg := range args {
|
|
switch arg.(type) {
|
|
case interfaces.User:
|
|
var ok bool
|
|
u, ok = arg.(interfaces.User)
|
|
if ok {
|
|
return u
|
|
}
|
|
}
|
|
}
|
|
return nil
|
|
}
|