♻️ Use omitzero for *bool, int64, and uint64
This commit is contained in:
1 parent
2d3ed8e0ba
commit
a1ad5bafde
11 files changed
+29
-29
No files matched your search
@@ -27,11 +27,11 @@ type Caption struct {
|
||||
common.Fields
|
||||
File string `yaml:"file" json:"file,omitempty"`
|
||||
AudioTrackType string `yaml:"audio_track_type" json:"audio_track_type,omitempty"`
|
||||
IsAutoSynced *bool `yaml:"is_auto_synced" json:"is_auto_synced,omitempty"`
|
||||
IsCC *bool `yaml:"is_cc" json:"is_cc,omitempty"`
|
||||
IsDraft *bool `yaml:"is_draft" json:"is_draft,omitempty"`
|
||||
IsEasyReader *bool `yaml:"is_easy_reader" json:"is_easy_reader,omitempty"`
|
||||
IsLarge *bool `yaml:"is_large" json:"is_large,omitempty"`
|
||||
IsAutoSynced *bool `yaml:"is_auto_synced" json:"is_auto_synced,omitzero"`
|
||||
IsCC *bool `yaml:"is_cc" json:"is_cc,omitzero"`
|
||||
IsDraft *bool `yaml:"is_draft" json:"is_draft,omitzero"`
|
||||
IsEasyReader *bool `yaml:"is_easy_reader" json:"is_easy_reader,omitzero"`
|
||||
IsLarge *bool `yaml:"is_large" json:"is_large,omitzero"`
|
||||
Language string `yaml:"language" json:"language,omitempty"`
|
||||
Name string `yaml:"name" json:"name,omitempty"`
|
||||
TrackKind string `yaml:"track_kind" json:"track_kind,omitempty"`
|
||||
|
||||
@@ -20,7 +20,7 @@ var (
|
||||
|
||||
type ChannelSection struct {
|
||||
common.Fields
|
||||
Mine *bool `yaml:"mine" json:"mine,omitempty"`
|
||||
Mine *bool `yaml:"mine" json:"mine,omitzero"`
|
||||
}
|
||||
|
||||
type IChannelSection[T any] interface {
|
||||
|
||||
@@ -25,12 +25,12 @@ var (
|
||||
type Comment struct {
|
||||
common.Fields
|
||||
AuthorChannelId string `yaml:"author_channel_id" json:"author_channel_id,omitempty"`
|
||||
CanRate *bool `yaml:"can_rate" json:"can_rate,omitempty"`
|
||||
CanRate *bool `yaml:"can_rate" json:"can_rate,omitzero"`
|
||||
ParentId string `yaml:"parent_id" json:"parent_id,omitempty"`
|
||||
TextFormat string `yaml:"text_format" json:"text_format,omitempty"`
|
||||
TextOriginal string `yaml:"text_original" json:"text_original,omitempty"`
|
||||
ModerationStatus string `yaml:"moderation_status" json:"moderation_status,omitempty"`
|
||||
BanAuthor *bool `yaml:"ban_author" json:"ban_author,omitempty"`
|
||||
BanAuthor *bool `yaml:"ban_author" json:"ban_author,omitzero"`
|
||||
VideoId string `yaml:"video_id" json:"video_id,omitempty"`
|
||||
ViewerRating string `yaml:"viewer_rating" json:"viewer_rating,omitempty"`
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ type Fields struct {
|
||||
RedirectURL string `yaml:"-" json:"-"`
|
||||
Ids []string `yaml:"ids" json:"ids,omitempty"`
|
||||
Confirmed bool `yaml:"-" json:"confirmed,omitempty"`
|
||||
MaxResults int64 `yaml:"max_results" json:"max_results,omitempty"`
|
||||
MaxResults int64 `yaml:"max_results" json:"max_results,omitzero"`
|
||||
Hl string `yaml:"hl" json:"hl,omitempty"`
|
||||
ChannelId string `yaml:"channel_id" json:"channel_id,omitempty"`
|
||||
Parts []string `yaml:"parts" json:"parts,omitempty"`
|
||||
|
||||
@@ -27,7 +27,7 @@ type LiveBroadcast struct {
|
||||
common.Fields
|
||||
Title string `yaml:"title" json:"title,omitempty"`
|
||||
Description string `yaml:"description" json:"description,omitempty"`
|
||||
Mine *bool `yaml:"mine" json:"mine,omitempty"`
|
||||
Mine *bool `yaml:"mine" json:"mine,omitzero"`
|
||||
BroadcastStatus string `yaml:"broadcast_status" json:"broadcast_status,omitempty"`
|
||||
BroadcastType string `yaml:"broadcast_type" json:"broadcast_type,omitempty"`
|
||||
PrivacyStatus string `yaml:"privacy_status" json:"privacy_status,omitempty"`
|
||||
@@ -36,9 +36,9 @@ type LiveBroadcast struct {
|
||||
StreamId string `yaml:"stream_id" json:"stream_id,omitempty"`
|
||||
|
||||
CueType string `yaml:"cue_type" json:"cue_type,omitempty"`
|
||||
CueDurationSecs int64 `yaml:"cue_duration_secs" json:"cue_duration_secs,omitempty"`
|
||||
CueInsertionOffsetMs int64 `yaml:"cue_insertion_offset_ms" json:"cue_insertion_offset_ms,omitempty"`
|
||||
CueWalltimeMs uint64 `yaml:"cue_walltime_ms" json:"cue_walltime_ms,omitempty"`
|
||||
CueDurationSecs int64 `yaml:"cue_duration_secs" json:"cue_duration_secs,omitzero"`
|
||||
CueInsertionOffsetMs int64 `yaml:"cue_insertion_offset_ms" json:"cue_insertion_offset_ms,omitzero"`
|
||||
CueWalltimeMs uint64 `yaml:"cue_walltime_ms" json:"cue_walltime_ms,omitzero"`
|
||||
|
||||
OnBehalfOfContentOwnerChannel string `yaml:"on_behalf_of_content_owner_channel" json:"on_behalf_of_content_owner_channel,omitempty"`
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ type LiveChatBan struct {
|
||||
common.Fields
|
||||
LiveChatId string `yaml:"live_chat_id" json:"live_chat_id,omitempty"`
|
||||
BannedUserChannelId string `yaml:"banned_user_channel_id" json:"banned_user_channel_id,omitempty"`
|
||||
BanDurationSeconds uint64 `yaml:"ban_duration_seconds" json:"ban_duration_seconds,omitempty"`
|
||||
BanDurationSeconds uint64 `yaml:"ban_duration_seconds" json:"ban_duration_seconds,omitzero"`
|
||||
BanType string `yaml:"ban_type" json:"ban_type,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ type LiveStream struct {
|
||||
common.Fields
|
||||
Title string `yaml:"title" json:"title,omitempty"`
|
||||
Description string `yaml:"description" json:"description,omitempty"`
|
||||
Mine *bool `yaml:"mine" json:"mine,omitempty"`
|
||||
Mine *bool `yaml:"mine" json:"mine,omitzero"`
|
||||
FrameRate string `yaml:"frame_rate" json:"frame_rate,omitempty"`
|
||||
IngestionType string `yaml:"ingestion_type" json:"ingestion_type,omitempty"`
|
||||
Resolution string `yaml:"resolution" json:"resolution,omitempty"`
|
||||
|
||||
@@ -24,7 +24,7 @@ type Playlist struct {
|
||||
common.Fields
|
||||
Title string `yaml:"title" json:"title,omitempty"`
|
||||
Description string `yaml:"description" json:"description,omitempty"`
|
||||
Mine *bool `yaml:"mine" json:"mine,omitempty"`
|
||||
Mine *bool `yaml:"mine" json:"mine,omitzero"`
|
||||
Tags []string `yaml:"tags" json:"tags,omitempty"`
|
||||
Language string `yaml:"language" json:"language,omitempty"`
|
||||
Privacy string `yaml:"privacy" json:"privacy,omitempty"`
|
||||
|
||||
@@ -24,10 +24,10 @@ var (
|
||||
|
||||
type PlaylistImage struct {
|
||||
common.Fields
|
||||
Height int64 `yaml:"height" json:"height,omitempty"`
|
||||
Height int64 `yaml:"height" json:"height,omitzero"`
|
||||
PlaylistId string `yaml:"playlist_id" json:"playlist_id,omitempty"`
|
||||
Type string `yaml:"type" json:"type,omitempty"`
|
||||
Width int64 `yaml:"width" json:"width,omitempty"`
|
||||
Width int64 `yaml:"width" json:"width,omitzero"`
|
||||
File string `yaml:"file" json:"file,omitempty"`
|
||||
Parent string `yaml:"parent" json:"parent,omitempty"`
|
||||
|
||||
|
||||
+9
-9
@@ -35,7 +35,7 @@ var (
|
||||
|
||||
type Video struct {
|
||||
common.Fields
|
||||
AutoLevels *bool `yaml:"auto_levels" json:"auto_levels,omitempty"`
|
||||
AutoLevels *bool `yaml:"auto_levels" json:"auto_levels,omitzero"`
|
||||
File string `yaml:"file" json:"file,omitempty"`
|
||||
Title string `yaml:"title" json:"title,omitempty"`
|
||||
Description string `yaml:"description" json:"description,omitempty"`
|
||||
@@ -50,20 +50,20 @@ type Video struct {
|
||||
PlaylistId string `yaml:"playlist_id" json:"playlist_id,omitempty"`
|
||||
CategoryId string `yaml:"category_id" json:"category_id,omitempty"`
|
||||
Privacy string `yaml:"privacy" json:"privacy,omitempty"`
|
||||
ForKids *bool `yaml:"for_kids" json:"for_kids,omitempty"`
|
||||
Embeddable *bool `yaml:"embeddable" json:"embeddable,omitempty"`
|
||||
ForKids *bool `yaml:"for_kids" json:"for_kids,omitzero"`
|
||||
Embeddable *bool `yaml:"embeddable" json:"embeddable,omitzero"`
|
||||
PublishAt string `yaml:"publish_at" json:"publish_at,omitempty"`
|
||||
RegionCode string `yaml:"region_code" json:"region_code,omitempty"`
|
||||
ReasonId string `yaml:"reason_id" json:"reason_id,omitempty"`
|
||||
Stabilize *bool `yaml:"stabilize" json:"stabilize,omitempty"`
|
||||
MaxHeight int64 `yaml:"max_height" json:"max_height,omitempty"`
|
||||
MaxWidth int64 `yaml:"max_width" json:"max_width,omitempty"`
|
||||
Stabilize *bool `yaml:"stabilize" json:"stabilize,omitzero"`
|
||||
MaxHeight int64 `yaml:"max_height" json:"max_height,omitzero"`
|
||||
MaxWidth int64 `yaml:"max_width" json:"max_width,omitzero"`
|
||||
|
||||
RecordingDate string `yaml:"recording_date" json:"recording_date,omitempty"`
|
||||
ContainsSyntheticMedia *bool `yaml:"contains_synthetic_media" json:"contains_synthetic_media,omitempty"`
|
||||
ContainsSyntheticMedia *bool `yaml:"contains_synthetic_media" json:"contains_synthetic_media,omitzero"`
|
||||
SecondaryReasonId string `yaml:"secondary_reason_id" json:"secondary_reason_id,omitempty"`
|
||||
NotifySubscribers *bool `yaml:"notify_subscribers" json:"notify_subscribers,omitempty"`
|
||||
PublicStatsViewable *bool `yaml:"public_stats_viewable" json:"public_stats_viewable,omitempty"`
|
||||
NotifySubscribers *bool `yaml:"notify_subscribers" json:"notify_subscribers,omitzero"`
|
||||
PublicStatsViewable *bool `yaml:"public_stats_viewable" json:"public_stats_viewable,omitzero"`
|
||||
OnBehalfOfContentOwnerChannel string `yaml:"on_behalf_of_content_owner_channel" json:"on_behalf_of_content_owner_channel,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ type Watermark struct {
|
||||
common.Fields
|
||||
File string `yaml:"file" json:"file,omitempty"`
|
||||
InVideoPosition string `yaml:"in_video_position" json:"in_video_position,omitempty"`
|
||||
DurationMs uint64 `yaml:"duration_ms" json:"duration_ms,omitempty"`
|
||||
OffsetMs uint64 `yaml:"offset_ms" json:"offset_ms,omitempty"`
|
||||
DurationMs uint64 `yaml:"duration_ms" json:"duration_ms,omitzero"`
|
||||
OffsetMs uint64 `yaml:"offset_ms" json:"offset_ms,omitzero"`
|
||||
OffsetType string `yaml:"offset_type" json:"offset_type,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user