internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package internal contains types and utilities that are not part of the public API, and may change without notice.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecModuleWithErrorTest

func ExecModuleWithErrorTest(t *testing.T, name string, loader ModuleLoadFunc, script string, wantErr error) (starlark.StringDict, error)

ExecModuleWithErrorTest executes a Starlark script with a module loader and compares the error with the expected error.

func HereDoc

func HereDoc(raw string) string

HereDoc returns un-indented string as here-document.

func HereDocf

func HereDocf(raw string, args ...interface{}) string

HereDocf returns unindented and formatted string as here-document. Formatting is done as for fmt.Printf().

Types

type FloatOrInt

type FloatOrInt float64

FloatOrInt is an Unpacker that converts a Starlark int or float to Go's float64.

func (*FloatOrInt) Unpack

func (p *FloatOrInt) Unpack(v starlark.Value) error

Unpack implements Unpacker.

type ModuleLoadFunc

type ModuleLoadFunc func() (starlark.StringDict, error)

ModuleLoadFunc is a function that loads a Starlark module and returns the module's string dict.

type ThreadLoadFunc

type ThreadLoadFunc func(thread *starlark.Thread, module string) (starlark.StringDict, error)

ThreadLoadFunc is a function that loads a Starlark module by name, usually used by the Starlark thread.

func NewAssertLoader

func NewAssertLoader(moduleName string, loader ModuleLoadFunc) ThreadLoadFunc

NewAssertLoader creates a Starlark thread loader that loads a module by name or asserts.star for testing.

Jump to

Keyboard shortcuts

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