inputs

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadCloseSizer

type ReadCloseSizer interface {
	io.ReadCloser
	Size() int
}

ReadCloseSizer is the interface that groups io.ReadCloser and Size methods.

func NewReadCloseSizer

func NewReadCloseSizer(r io.ReadCloser, size int) ReadCloseSizer

NewReadCloseSizer turns ReadCloser into ReadCloserSizer by adding Size method that always returns initially bound size.

type SourceInput

type SourceInput interface {
	NewReader(filename string) (ReadCloseSizer, error)
	NewBytesReader(filename string, data []byte) (ReadCloseSizer, error)
}

SourceInput interface describes linter source code inputs that can come from files and buffers.

One of the responsibilities of the SourceInput is to return readers that can be treated like they always have UTF-8 encoded data. If real data has different encoding, it's up to the implementation to detect and fix that.

func NewDefaultSourceInput

func NewDefaultSourceInput() SourceInput

NewDefaultSourceInput returns the default SourceInput implementation that operates with filesystem directly.

It assumes that all sources are UTF-8 encoded.

Jump to

Keyboard shortcuts

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