Standard escape codes are prefixed with Escape
:
- Ctrl-Key:
^[
- Octal:
\033
- Unicode:
\u001b
- Hexadecimal:
\x1B
- Decimal:
27
package main | |
import ( | |
"fmt" | |
"image/color" | |
"github.com/ebitenui/ebitenui" | |
"github.com/ebitenui/ebitenui/image" | |
"github.com/ebitenui/ebitenui/widget" | |
"github.com/hajimehoshi/ebiten/v2" |
package main | |
import ( | |
"image/color" | |
"github.com/ebitenui/ebitenui" | |
"github.com/ebitenui/ebitenui/image" | |
"github.com/ebitenui/ebitenui/widget" | |
"github.com/hajimehoshi/ebiten/v2" | |
"golang.org/x/image/colornames" |
package main | |
import "graceful" | |
func main() { | |
graceful.Ensure() | |
mysql, err := NewMySQL() | |
if err != nil { | |
graceful.Stop(fmt.Errorf("mysql: %w", err)) |
package request | |
type Option = func(req *http.Request) | |
func Do( | |
client *http.Client, | |
ctx context.Context, | |
method, url, resource string, | |
in, out any, options ...Option, | |
) (e error) { |
package main | |
import ( | |
"testing" | |
) | |
var fib = 12 | |
func BenchmarkPlainFib(b *testing.B) { | |
for i := 0; i < b.N; i++ { |
func initAnyType[T any]() *T { | |
var x T | |
t := reflect.TypeOf(x) | |
v := reflect.New(t) | |
if t.Kind() == reflect.Struct { | |
walkInitStruct(t, v.Elem()) | |
} |
package main | |
import ( | |
"fmt" | |
"strconv" | |
) | |
type Point struct { | |
Name int | |
Marked // You don't need to initialize it |
package main | |
import ( | |
"bytes" | |
"embed" | |
"fmt" | |
"image" | |
"log" | |
"math" | |
"image/color" |
import "image" | |
type SubImager interface { | |
SubImage(r image.Rectangle) image.Image | |
} | |
// RelativeSubImage return cropped image relative to the previous crop | |
// If you try to make a sub image from another sub image, you may run into | |
// unusual behavior due to the fact that absolute coordinates are used for each crop, | |
// instead you can use this function so as not to constantly remember this nuance. |