mirror of
https://github.com/miniflux/v2.git
synced 2024-08-22 20:33:41 +02:00
29 lines
603 B
Go
29 lines
603 B
Go
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package model // import "miniflux.app/v2/internal/model"
|
|
|
|
// OptionalString populates an optional string field.
|
|
func OptionalString(value string) *string {
|
|
if value != "" {
|
|
return &value
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// OptionalInt populates an optional int field.
|
|
func OptionalInt(value int) *int {
|
|
if value > 0 {
|
|
return &value
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// OptionalInt64 populates an optional int64 field.
|
|
func OptionalInt64(value int64) *int64 {
|
|
if value > 0 {
|
|
return &value
|
|
}
|
|
return nil
|
|
}
|