fitstringer

package
v0.0.0-...-1b615d8 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package fitstringer is a fork of golang.org/x/tools/cmd/stringer used to generate string methods for the FIT types generated by cmd/fitgen. It is now a library instead of a command. It also has slightly different logic for prefix trimming compared to the original. This version will always remove the type name prefix for each generated type.

golang.org/x/tools commit used as base: https://github.com/golang/tools/commit/63e6ed9258fa6cbc90aab9b1eef3e0866e89b874

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(types []string, files ...string) ([]byte, error)

Generate generates string methods using the logic from the official stringer tool, but does not write the output to a file, and instead returns the output source code as bytes. It takes a given set of type name and their source definitions as input. Each type will also have its name prefix removed from the resulting string methods.

Types

This section is empty.

Jump to

Keyboard shortcuts

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