@@ -22,8 +22,6 @@ import (
2222 "gopkg.in/tomb.v2"
2323 "gopkg.in/yaml.v3"
2424
25- "github.com/crowdsecurity/go-cs-lib/ptr"
26-
2725 "github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/core/args"
2826 "github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/core/require"
2927 "github.com/crowdsecurity/crowdsec/pkg/apiclient"
@@ -321,34 +319,34 @@ func (cli *cliNotifications) newTestCmd() *cobra.Command {
321319 return nil
322320 })
323321 alert := & models.Alert {
324- Capacity : ptr . Of (int32 (0 )),
322+ Capacity : new (int32 (0 )),
325323 Decisions : []* models.Decision {{
326- Duration : ptr . Of ("4h" ),
327- Scope : ptr . Of ("Ip" ),
328- Value : ptr . Of ("10.10.10.10" ),
329- Type : ptr . Of ("ban" ),
330- Scenario : ptr . Of ("test alert" ),
331- Origin : ptr . Of (types .CscliOrigin ),
324+ Duration : new ("4 h "),
325+ Scope : new ("Ip "),
326+ Value : new ("10.10 .10 .10 "),
327+ Type : new ("ban "),
328+ Scenario : new ("test alert "),
329+ Origin : new (types.CscliOrigin ),
332330 }},
333331 Events : []* models.Event {},
334- EventsCount : ptr . Of (int32 (1 )),
335- Leakspeed : ptr . Of ("0" ),
336- Message : ptr . Of ("test alert" ),
337- ScenarioHash : ptr . Of ("" ),
338- Scenario : ptr . Of ("test alert" ),
339- ScenarioVersion : ptr . Of ("" ),
340- Simulated : ptr . Of (false ),
332+ EventsCount : new (int32 (1 )),
333+ Leakspeed : new ("0 "),
334+ Message : new ("test alert "),
335+ ScenarioHash : new (""),
336+ Scenario : new ("test alert "),
337+ ScenarioVersion : new (""),
338+ Simulated : new (false ),
341339 Source : & models.Source {
342340 AsName : "" ,
343341 AsNumber : "" ,
344342 Cn : "" ,
345343 IP : "10.10.10.10" ,
346344 Range : "" ,
347- Scope : ptr . Of ("Ip" ),
348- Value : ptr . Of ("10.10.10.10" ),
345+ Scope : new ("Ip "),
346+ Value : new ("10.10 .10 .10 "),
349347 },
350- StartAt : ptr . Of (time .Now ().UTC ().Format (time .RFC3339 )),
351- StopAt : ptr . Of (time .Now ().UTC ().Format (time .RFC3339 )),
348+ StartAt : new (time.Now ().UTC ().Format (time .RFC3339 )),
349+ StopAt : new (time.Now ().UTC ().Format (time .RFC3339 )),
352350 CreatedAt : time .Now ().UTC ().Format (time .RFC3339 ),
353351 }
354352 if err := yaml .Unmarshal ([]byte (alertOverride ), alert ); err != nil {
@@ -368,8 +366,8 @@ func (cli *cliNotifications) newTestCmd() *cobra.Command {
368366 },
369367 }
370368 cmd .Flags ().StringVarP (& alertOverride , "alert" , "a" , "" ,
371- "JSON string used to override alert fields in the generic alert " +
372- "(see crowdsec/pkg/models/alert.go in the source tree for the full definition of the object)" )
369+ "JSON string used to override alert fields in the generic alert " +
370+ "(see crowdsec/pkg/models/alert.go in the source tree for the full definition of the object)" )
373371
374372 return cmd
375373}
@@ -489,8 +487,8 @@ cscli notifications reinject <alert_id> -a '{"remediation": true,"scenario":"not
489487 },
490488 }
491489 cmd .Flags ().StringVarP (& alertOverride , "alert" , "a" , "" ,
492- "JSON string used to override alert fields in the reinjected alert " +
493- "(see crowdsec/pkg/models/alert.go in the source tree for the full definition of the object)" )
490+ "JSON string used to override alert fields in the reinjected alert " +
491+ "(see crowdsec/pkg/models/alert.go in the source tree for the full definition of the object)" )
494492
495493 return cmd
496494}
0 commit comments