Skip to content

Commit

Permalink
use time pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
broswen committed Aug 4, 2023
1 parent 6fd817e commit dac6a02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions web_analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ var listWebAnalyticsSitesDefaultPageSize = 10

// WebAnalyticsSite describes a Web Analytics Site object.
type WebAnalyticsSite struct {
SiteTag string `json:"site_tag"`
SiteToken string `json:"site_token"`
Created time.Time `json:"created,omitempty"`
SiteTag string `json:"site_tag"`
SiteToken string `json:"site_token"`
Created *time.Time `json:"created,omitempty"`
// Snippet is an encoded JS script to insert into your site HTML.
Snippet string `json:"snippet"`
// AutoInstall defines whether Cloudflare will inject the JS snippet automatically for orange-clouded sites.
Expand All @@ -39,8 +39,8 @@ type WebAnalyticsRule struct {
Host string `json:"host"`
Paths []string `json:"paths"`
// Inclusive defines whether the rule includes or excludes the matched traffic from being measured in web analytics.
Inclusive bool `json:"inclusive"`
Created time.Time `json:"created,omitempty"`
Inclusive bool `json:"inclusive"`
Created *time.Time `json:"created,omitempty"`
// IsPaused defines whether the rule is paused (inactive) or not.
IsPaused bool `json:"is_paused"`
Priority int `json:"priority,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions web_analytics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var site = WebAnalyticsSite{
Rules: []WebAnalyticsRule{
rule,
},
Created: createdTimestamp.UTC(),
Created: TimePtr(createdTimestamp.UTC()),
}

var ruleset = WebAnalyticsRuleset{
Expand All @@ -98,7 +98,7 @@ var rule = WebAnalyticsRule{
"*",
},
Inclusive: true,
Created: createdTimestamp.UTC(),
Created: TimePtr(createdTimestamp.UTC()),
IsPaused: false,
Priority: 1000,
}
Expand Down

0 comments on commit dac6a02

Please sign in to comment.