gats

package module
v0.0.0-...-055bc91 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 2 Imported by: 3

README

gats

Returns the value declared in go's basic type as a string.
gats is named as an abbreviation of go any to string.

Importing

import (
    "github.com/harakeishi/gats"
)

Documentation

Visit the docs on GoDoc

usage

package main

import (
	"fmt"
	"github.com/harakeishi/gats"
)

func main() {
	value := []byte("test")
	result, err := gats.ToString(value)
    if err != nil {
        fmt.Println(err)
    }
	fmt.Println(result)
    // Output: test
}

License

Copyright (c) 2023 harakeishi

Licensed under MIT

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToString

func ToString(a any) (string, error)

Returns the value of the passed basic type as a `string`.

Example
value := int16(11)
result, err := ToString(value)
if err != nil {
	fmt.Println(err)
}
fmt.Println(result)
Output:

11

Types

This section is empty.

Jump to

Keyboard shortcuts

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