github.com/blend/go-sdk@v1.20220411.3/configutil/int32.go (about) 1 /* 2 3 Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved 4 Use of this source code is governed by a MIT license that can be found in the LICENSE file. 5 6 */ 7 8 package configutil 9 10 import "context" 11 12 var ( 13 _ Int32Source = (*Int32)(nil) 14 ) 15 16 // Int32 implements value provider. 17 // 18 // Note: Int32 treats 0 as unset, if 0 is a valid value you must use configutil.Int32Ptr. 19 type Int32 int32 20 21 // Int32 returns the value for a constant. 22 func (i Int32) Int32(_ context.Context) (*int32, error) { 23 if i > 0 { 24 value := int32(i) 25 return &value, nil 26 } 27 return nil, nil 28 }