Skip to content

Setting: ignoreMissing ‚Äč

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

If the source struct has multiple missing exported fields that should be ignored, then you can enable ignoreMissing, to ignore these.


Using this setting is not recommended, because this can easily lead to unwanted behavior when e.g. renaming fields on a struct and forgetting to change the goverter converter accordingly.

package example

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

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

package generated

import ignoremissing ""

type ConverterImpl struct{}

func (c *ConverterImpl) Convert(source ignoremissing.Input) ignoremissing.Output {
	var exampleOutput ignoremissing.Output
	exampleOutput.Name = source.Name
	return exampleOutput