mirror of
https://github.com/datarhei/core.git
synced 2025-10-06 00:17:07 +08:00
Fix linter warnings
This commit is contained in:
@@ -88,11 +88,7 @@ func NewWithConfig(config Config) echo.MiddlewareFunc {
|
|||||||
|
|
||||||
// Sort the mounts from longest to shortest
|
// Sort the mounts from longest to shortest
|
||||||
sort.Slice(mw.mounts, func(i, j int) bool {
|
sort.Slice(mw.mounts, func(i, j int) bool {
|
||||||
if len(mw.mounts[i]) > len(mw.mounts[j]) {
|
return len(mw.mounts[i]) > len(mw.mounts[j])
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
})
|
})
|
||||||
|
|
||||||
mw.logger.Debug().WithField("mounts", mw.mounts).Log("")
|
mw.logger.Debug().WithField("mounts", mw.mounts).Log("")
|
||||||
|
@@ -62,6 +62,9 @@ func DummyRestreamer(pathPrefix string) (restream.Restreamer, error) {
|
|||||||
JWTSecret: "",
|
JWTSecret: "",
|
||||||
Logger: nil,
|
Logger: nil,
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
iam.AddPolicy("$anon", "$none", "api:/**", "ANY")
|
iam.AddPolicy("$anon", "$none", "api:/**", "ANY")
|
||||||
iam.AddPolicy("$anon", "$none", "fs:/**", "ANY")
|
iam.AddPolicy("$anon", "$none", "fs:/**", "ANY")
|
||||||
|
@@ -47,6 +47,9 @@ func getDummyRestreamer(portrange net.Portranger, validatorIn, validatorOut ffmp
|
|||||||
JWTSecret: "",
|
JWTSecret: "",
|
||||||
Logger: nil,
|
Logger: nil,
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
iam.AddPolicy("$anon", "$none", "process:*", "CREATE|GET|DELETE|UPDATE|COMMAND|PROBE|METADATA|PLAYOUT")
|
iam.AddPolicy("$anon", "$none", "process:*", "CREATE|GET|DELETE|UPDATE|COMMAND|PROBE|METADATA|PLAYOUT")
|
||||||
|
|
||||||
@@ -443,7 +446,7 @@ func TestProcessMetadata(t *testing.T) {
|
|||||||
rs.AddProcess(process)
|
rs.AddProcess(process)
|
||||||
|
|
||||||
data, err := rs.GetProcessMetadata(process.ID, "", "", "foobar")
|
data, err := rs.GetProcessMetadata(process.ID, "", "", "foobar")
|
||||||
require.Error(t, ErrMetadataKeyNotFound)
|
require.Equal(t, ErrMetadataKeyNotFound, err)
|
||||||
require.Equal(t, nil, data, "nothing should be stored under the key")
|
require.Equal(t, nil, data, "nothing should be stored under the key")
|
||||||
|
|
||||||
err = rs.SetProcessMetadata(process.ID, "", "", "foobar", process)
|
err = rs.SetProcessMetadata(process.ID, "", "", "foobar", process)
|
||||||
|
Reference in New Issue
Block a user