syntax

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchRelatedValue

func ArchRelatedValue[T any](x64 T, x86 T, arm64 T, arm T, others T) T

ArchRelatedValue returns the value of the os and arch related parameter.

func Comment

func Comment(_ any)

Comment is a comment in a source file. Allows comment with syntax colouring

func Default

func Default[T any]() (t T)

Default returns the default value of a type.

func DoNot added in v0.0.14

func DoNot(_ any)

DoNot is a comment in a source file. Allows comment with syntax colouring

func Example added in v0.0.14

func Example(_ any)

Example is a comment in a source file. Allows comment with syntax colouring

func If

func If(b bool, f func())

If is a functionalise of if statement

func IfThenElse

func IfThenElse[T any](ifCon bool, thenCase T, elseCase T) T

IfThenElse returns the result of the thenCase if the ifCon is true, else the result of the elseCase. it provides a ternary operator-like syntax.

func OsRelatedValue

func OsRelatedValue[T any](windows T, linux T, darwin T, others T) T

OsRelatedValue returns the value of the os related parameter.

func TryCatch

func TryCatch(try func(), catch func(any)) (ok bool)

TryCatch is a try-catch statement.

func TryCatchFinally added in v0.0.13

func TryCatchFinally(try func(), catch func(any), finally func()) (ok bool)

TryCatchFinally is a try-catch-finally statement.

func TryFinally added in v0.0.13

func TryFinally(try func(), finally func())

TryFinally is a try-finally statement.

Types

This section is empty.

Jump to

Keyboard shortcuts

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