Copyright 2018, The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE.md file.

package cmpopts

import (
	
)

type xformFilter struct{ xform cmp.Option }

func ( xformFilter) ( cmp.Path) bool {
	for ,  := range  {
		if ,  := .(cmp.Transform);  && .Option() == .xform {
			return false
		}
	}
	return true
}
AcyclicTransformer returns a Transformer with a filter applied that ensures that the transformer cannot be recursively applied upon its own output. An example use case is a transformer that splits a string by lines: AcyclicTransformer("SplitLines", func(s string) []string{ return strings.Split(s, "\n") }) Had this been an unfiltered Transformer instead, this would result in an infinite cycle converting a string to []string to [][]string and so on.
func ( string,  interface{}) cmp.Option {
	 := xformFilter{cmp.Transformer(, )}
	return cmp.FilterPath(.filter, .xform)