align

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringWidth

func StringWidth[T Ordered](s string) (width T)

StringWidth PS: 对齐要求 1. minWidth =50 2.对于goland需要consolas.ttf,设置--》editor-->font-->consolas 3. fmt.Printf(" 姓名:%s \t 分数:%d\n", formattedName, score) //因为特殊字符的视觉宽度真的就是以像素为单位的,加一个\t 4. gio代码编辑器字体设置似乎没生效,得用consolas.ttf,logview对不齐也是字体没生效的原因

Types

type Complex

type Complex interface {
	~complex64 | ~complex128
}

type Float

type Float interface {
	~float32 | ~float64
}

type Integer

type Integer interface {
	Signed | Unsigned
}

type Ordered

type Ordered interface {
	Integer | Float // | ~string
}

type Signed

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Jump to

Keyboard shortcuts

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