gocontracts

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2019 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process(text string, filename string, remove bool) (updated string, err error)

Process automatically adds (or updates) the blocks for checking the pre and postconditions. If remove is set, the code to check the conditions is removed, but the conditions are left untouched in the comment.

func ProcessFile added in v1.1.0

func ProcessFile(pth string, remove bool) (updated string, err error)

ProcessFile loads the Go file and processes it. If remove is set, the code to check the conditions is removed, but the conditions are left untouched in the comment.

func ProcessInPlace added in v1.1.0

func ProcessInPlace(pth string, remove bool) (err error)

ProcessInPlace loads the Go file in memory, proesses it and writes atomically back to the file. If remove is set, the code to check the conditions is removed, but the conditions are left untouched in the comment.

Types

This section is empty.

Directories

Path Synopsis
Package testcases contains files with recorded or imagined inputs and expected outputs / errors.
Package testcases contains files with recorded or imagined inputs and expected outputs / errors.

Jump to

Keyboard shortcuts

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