to_be

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

README

to-be.Go

Simple Go library determining the truthyness of strings, that is whether they indicate truey or falsy values.

Introduction

to-be is a library providing facilities for determine whether the truthyness of strings. It implemented in several languages: to-be.Go is the Go implementation.

Table of Contents

Terminology

The term "truthy" is an unhelpfully overloaded term in the programming world, insofar as it is used to refer to the notion of "truthyness" - whether something can be deemed to be interpretable as truth - and also the true side of that interpretation. In this library, the former interpretation is used, leaving us with the following terms:

  • "truthy" - whether something can be can be deemed to be interpretable as having truth;
  • "falsey" - whether an object can be deemed to be interpretable as being false;
  • "truey" - whether an object can be deemed to be interpretable as being true;

For example, consider the following Go program:

package main

import (
	to_be "github.com/synesissoftware/to-be.Go"
)

s1 := "no"
s2 := "True"
s3 := "orange"

// "no" is validly truthy, and is falsey
to_be.StringIsFalsey(s1)  // true
to_be.StringIsTruey(s1)   // false
to_be.StringIsTruthy(s1)  // true

// "True" is validly truthy, and is truey
to_be.StringIsFalsey(s2)  // false
to_be.StringIsTruey(s2)   // true
to_be.StringIsTruthy(s2)  // true

// "orange" is not validly truthy, and is neither falsey nor truey
to_be.StringIsFalsey(s3)  // false
to_be.StringIsTruey(s3)   // false
to_be.StringIsTruthy(s3)  // false

Installation


import to-be "github.com/synesissoftware/to-be.Go"

Components

TBC

Examples

Examples are provided in the examples directory, along with a markdown description for each. A detailed list TOC of them is provided in EXAMPLES.md.

Project Information

Where to get help

GitHub Page

Contribution guidelines

Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/to-be.Go.

Dependencies
Development/Testing Dependencies
License

to-be.Go is released under the 3-clause BSD license. See LICENSE for details.

Documentation

Index

Constants

View Source
const (
	VersionMajor uint16 = 0
	VersionMinor uint16 = 1
	VersionPatch uint16 = 0
	VersionAB    uint16 = 0xFFFF
	Version      uint64 = (uint64(VersionMajor) << 48) + (uint64(VersionMinor) << 32) + (uint64(VersionPatch) << 16) + (uint64(VersionAB) << 0)
)

Variables

This section is empty.

Functions

func StringIsFalsey

func StringIsFalsey(s string) bool

func StringIsTruey

func StringIsTruey(s string) bool

func StringIsTruthy

func StringIsTruthy(s string) bool

func VersionString

func VersionString() string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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