imports

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright 2023 Go Imports Organizer Contributors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSpaces

func AddSpaces(r io.Reader, breaks []string) ([]byte, error)

AddSpaces adds empty lines (spaces) between the groups of imports borrowed from https://github.com/golang/tools/blob/71482053b885ea3938876d1306ad8a1e4037f367/internal/imports/imports.go#L380

func Format

func Format(files *chan string, wg *sync.WaitGroup, groupRegExpMatchers []v1alpha1.RegExpMatcher, displayOrder []string, listOnly *bool)

Format processes files as they are added to the queue and organizes the imports

func InsertGroups

func InsertGroups(f *ast.File, importGroups map[string][]ast.ImportSpec, displayOrder []string) ([]string, error)

InsertGroup places the groups of ImportSpecs into their correct order in the File according to the display order

func PopulateGroups

func PopulateGroups(importGroups map[string][]ast.ImportSpec, regExpMatchers []v1alpha1.RegExpMatcher, imports []*ast.ImportSpec) error

PopulateGroups assembles the data structure that is used to hold the groups of ImportSpecs as they are organized

Types

This section is empty.

Jump to

Keyboard shortcuts

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