GoLobby Cast is a lightweight casting package for Go projects.


Required Go Versions

It requires Go v1.11 or newer versions.


To install this package, run the following command in your project directory.

go get

Usage Example

The following examples demonstrate how to use the GoLobby Cast package.

val, err := cast.FromString("666", "int32")
// `val` type: int32
// `val` value: 666
val, err := cast.FromString("1", cast.Bool)
// `val` type: bool
// `val` value: true

Supported Types

Currently, the GoLobby Cast supports the following types:

  • Int (Int8 .. Int64)
  • Uint (Uint8 .. Uint64)
  • Float32 and Float64
  • Bool
  • String