validate

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package validate provides contextual validation for file.File.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(f *file.File) error

File runs all contextual validation for the file, and all the other files it uses.

If you have a library that you want to validate, you should call Library instead, which will run all the validation File does, plus extra library-specific validation.

It expects the file to be linked and its metadata to be set and PreLink to be run.

Since File recursively validates all files it encounters, it is neither necessary nor performant to validate the files f depends on individually. Instead, you should fully link f and all its dependencies and then run File on f.

If File returns an error, that error will be of type corgierr.List.

func Library

func Library(l *file.Library) error

Library runs all the rules File runs and some additional library-specific rules.

Just like File, Library recursively validates all files and should therefore only be called if compiling a library.

Read the doc of File for more information about requirements and Library's return value.

func PreLink(f *file.File) error

PreLink validates that there are no namespace collisions in the file's uses.

It should be run before linking.

It expects the file's metadata to be set.

If it returns an error, that error will be of type corgierr.List.

Types

This section is empty.

Jump to

Keyboard shortcuts

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