almasbub

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

README

Almasbub (translation : cast)

Description

Almasbub (translate : cast) is a library to provides an easy and safe datatype cast in Go. :

Importing

Before importing almasbub into your code, first download almasbub using go get tool.

$ go get bitbucket.org/rctiplus/almasbub 

To use the almasbub, simply adding the following import statement to your .go files.

import "bitbucket.org/rctiplus/almasbub" // with go modules disabled

Documentation

Further documentation can be found on pkg.go.dev

FAQ

Can I contribute to make Almasbub?

Please do! We are looking for any kind of contribution to improve Almasbub core funtionality and documentation. When in doubt, make a PR!

License

Copyright (c) 2020, RCTIPlus

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Documentation

Overview

Copyright © 2020 RCTIPlus <rctiplus.com>. almasbub package provides an easy and safe datatype cast in Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToBool

func ToBool(i interface{}) bool

ToBool return casts of an interface to a bool type. v := almasbub.ToBool(1) fmt.Println(v) Output: true

func ToDuration

func ToDuration(i interface{}) time.Duration

ToDuration return casts of an interface to a time.Duration type. v := almasbub.ToDuration(1) fmt.Println(v) Output: true

func ToFloat32

func ToFloat32(i interface{}) float32

ToFloat32 return casts of an interface to a float32 type. v := almasbub.ToFloat32(1) fmt.Println(v) Output: true

func ToFloat64

func ToFloat64(i interface{}) float64

ToFloat64 return casts of an interface to a float64 type. v := almasbub.ToFloat64(1) fmt.Println(v) Output: true

func ToInt

func ToInt(i interface{}) int

ToInt return casts of an interface to an int type. v := almasbub.ToInt(1) fmt.Println(v) Output: true

func ToInt16

func ToInt16(i interface{}) int16

ToInt16 return casts of an interface to an int16 type. v := almasbub.ToInt16(1) fmt.Println(v) Output: true

func ToInt32

func ToInt32(i interface{}) int32

ToInt32 return casts of an interface to an int32 type. v := almasbub.ToInt32(1) fmt.Println(v) Output: true

func ToInt64

func ToInt64(i interface{}) int64

ToInt64 return casts of an interface to an int64 type. v := almasbub.ToInt64(1) fmt.Println(v) Output: true

func ToInt8

func ToInt8(i interface{}) int8

ToInt8 return casts of an interface to an int8 type. v := almasbub.ToInt8(1) fmt.Println(v) Output: true

func ToString

func ToString(i interface{}) string

ToString return casts of an interface to a string type. v := almasbub.ToString(1) fmt.Println(v) Output: true

func ToStringDate

func ToStringDate(i string) (time.Time, error)

ToStringDate return casts of an string time intto a time type and error if failed. v := almasbub.ToStringDate(1) fmt.Println(v) Output: true

func ToTime

func ToTime(i interface{}) time.Time

ToTime return casts of an interface to a time.Time type. v := almasbub.ToTime(30) fmt.Println(v) Output: 30

func ToUint

func ToUint(i interface{}) uint

ToUint return casts of an interface to a uint type. v := almasbub.ToUint(1) fmt.Println(v) Output: true

func ToUint16

func ToUint16(i interface{}) uint16

ToUint16 return casts of an interface to a uint16 type. v := almasbub.ToUint16(1) fmt.Println(v) Output: true

func ToUint32

func ToUint32(i interface{}) uint32

ToUint32 return casts of an interface to a uint32 type. v := almasbub.ToUint32(1) fmt.Println(v) Output: true

func ToUint64

func ToUint64(i interface{}) uint64

ToUint64 return casts of an interface to a uint64 type. v := almasbub.ToUint64(1) fmt.Println(v) Output: true

func ToUint8

func ToUint8(i interface{}) uint8

ToUint8 return casts of an interface to a uint8 type. v := almasbub.ToUint8(1) fmt.Println(v) Output: true

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL