gentesthelper

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffGoCode

func DiffGoCode(inA, inB string) (outA, outB, diff string)

DiffGoCode returns normalized versions of inA and inB using the go formatter so that differences in indentation or trailing spaces are ignored. A diff of inA and inB is also returned.

func DiffStrings

func DiffStrings(a, b string) string

DiffStrings returns the line differences of two strings. Useful for examining how generated code differs from expected code.

func FuncSourceCode

func FuncSourceCode(val interface{}) (string, error)

FuncSourceCode returns a string representing the source code of the function provided to it.

func TestFormat

func TestFormat(code string) (string, error)

testFormat takes a string representing golang code and attempts to return a formated copy of that code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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