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 ¶
- func AddSpaces(r io.Reader, breaks []string) ([]byte, error)
- func Format(files *chan string, resultsChan *chan string, hasResults *bool, ...)
- func InsertGroups(f *ast.File, importGroups map[string][]ast.ImportSpec, displayOrder []string) ([]string, error)
- func PopulateGroups(importGroups map[string][]ast.ImportSpec, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSpaces ¶
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, resultsChan *chan string, hasResults *bool, 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.