goremovelines: github.com/Eun/goremovelines Index | Files

package goremovelines

import "github.com/Eun/goremovelines"

Index

Package Files

goremovelines.go

Constants

const (
    // FuncMode should be set to remove empty lines in functions
    FuncMode = 1 << iota
    // StructMode should be set to remove empty lines in structs
    StructMode = 1 << iota
    // IfMode should be set to remove empty lines in if blocks
    IfMode = 1 << iota
    // SwitchMode should be set to remove empty lines in functions
    SwitchMode = 1 << iota
    // CaseMode should be set to remove empty lines in case blocks
    CaseMode = 1 << iota
    // ForMode should be set to remove empty lines in for blocks
    ForMode = 1 << iota
    // InterfaceMode should be set to remove empty lines in interface blocks
    InterfaceMode = 1 << iota
    // BlockMode should be set to remove empty lines in blocks
    BlockMode = 1 << iota
    // AllMode includes all modes
    AllMode = FuncMode | StructMode | IfMode | SwitchMode | CaseMode | ForMode | InterfaceMode | BlockMode
)

Variables

var Debug = false

Debug enables/disables debug output

func CleanFile Uses

func CleanFile(src string, out io.Writer, mode Mode) error

CleanFile cleans a source code with the specific mode, it writes the cleaned output to `out`

func CleanFilePath Uses

func CleanFilePath(path string, out io.Writer, mode Mode) error

CleanFilePath cleans a file with the specific mode, it writes the cleaned output to `out`

type Mode Uses

type Mode int

Mode is a bitmask that defines which lines should be removed

Package goremovelines imports 11 packages (graph). Updated 2019-05-06. Refresh now. Tools for package owners.