Skip to content

Setting: matchIgnoreCase ‚Äč

matchIgnoreCase [yes,no] is a boolean setting and can be defined as CLI argument, converter comment or method comment. This setting is inheritable.

Enable matchIgnoreCase to instructs goverter to match fields ignoring differences in capitalization. If there are multiple matches then goverter will prefers an exact match (if present) or reports an error. Use map to fix an ambiquous match error.

package example

// goverter:converter
type Converter interface {
	// goverter:matchIgnoreCase
	Convert(Input) Output

type Input struct {
	Age      int
	Fullname string
type Output struct {
	Age      int
	FULLNAME string
// Code generated by, DO NOT EDIT.
//go:build !goverter

package generated

import matchignorecase ""

type ConverterImpl struct{}

func (c *ConverterImpl) Convert(source matchignorecase.Input) matchignorecase.Output {
	var exampleOutput matchignorecase.Output
	exampleOutput.Age = source.Age
	exampleOutput.FULLNAME = source.Fullname
	return exampleOutput