Repository: lyraproj/hiera
Pull request #73 (2020-02-12 14:36:01)

Update to dgo v0.4.1


Patch:
diff --git a/.idea/jsonSchemas.xml b/.idea/jsonSchemas.xml
index 1b10be8..b5f373f 100644
--- a/.idea/jsonSchemas.xml
+++ b/.idea/jsonSchemas.xml
@@ -12,14 +12,9 @@
                 <list>
                   <Item>
                     <option name="pattern" value="true" />
-                    <option name="path" value="hiera.yaml" />
+                    <option name="path" value="*hiera.yaml" />
                     <option name="mappingKind" value="Pattern" />
                   </Item>
-                  <Item>
-                    <option name="directory" value="true" />
-                    <option name="path" value="lookup/testdata" />
-                    <option name="mappingKind" value="Directory" />
-                  </Item>
                 </list>
               </option>
             </SchemaInfo>
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 94a25f7..029a1a8 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,5 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
+  <component name="CommitMessageInspectionProfile">
+    <profile version="1.0">
+      <inspection_tool class="BodyLimit" enabled="true" level="WARNING" enabled_by_default="true" />
+      <inspection_tool class="SubjectBodySeparation" enabled="true" level="WARNING" enabled_by_default="true" />
+      <inspection_tool class="SubjectLimit" enabled="true" level="WARNING" enabled_by_default="true" />
+    </profile>
+  </component>
   <component name="VcsDirectoryMappings">
     <mapping directory="$PROJECT_DIR$" vcs="Git" />
   </component>
diff --git a/config/config.go b/config/config.go
index ddb6204..8a39784 100644
--- a/config/config.go
+++ b/config/config.go
@@ -65,6 +65,13 @@ const hieraTypeString = `{
 // FileName is the default file name for the Hiera configuration file.
 const FileName = `hiera.yaml`
 
+var cfgType dgo.Type
+
+func init() {
+	tf.ParseType(definitions)
+	cfgType = tf.ParseType(hieraTypeString)
+}
+
 // New creates a new unresolved Config from the given path. If the path does not exist, the
 // default config is returned.
 func New(configPath string) api.Config {
@@ -83,15 +90,15 @@ func New(configPath string) api.Config {
 		return dc
 	}
 
-	aliasMap := tf.NewAliasMap()
-	tf.ParseFile(aliasMap, `internal definitions`, definitions)
-	cfgType := tf.ParseFile(aliasMap, `internal config`, hieraTypeString)
 	yv, err := yaml.Unmarshal(content)
 	if err != nil {
 		panic(err)
 	}
 	cfgMap := yv.(dgo.Map)
-	cfgMap.SetType(cfgType)
+	if !cfgType.Instance(cfgMap) {
+		panic(tf.IllegalAssignment(cfgType, cfgMap))
+	}
+
 	return createConfig(configPath, cfgMap)
 }
 
diff --git a/explain/explainer.go b/explain/explainer.go
index 7f1bfd5..e1e8603 100644
--- a/explain/explainer.go
+++ b/explain/explainer.go
@@ -110,7 +110,7 @@ func initialize(en explainNode, ih dgo.Map) {
 }
 
 func initMap(en explainNode) dgo.Map {
-	m := vf.MapWithCapacity(7, nil)
+	m := vf.MapWithCapacity(7)
 	if bs := en.branches(); len(bs) > 0 {
 		m.Put(`branches`, vf.Array(bs))
 	}
diff --git a/go.mod b/go.mod
index d9b1d03..48248a1 100644
--- a/go.mod
+++ b/go.mod
@@ -2,16 +2,16 @@ module github.com/lyraproj/hiera
 
 require (
 	github.com/bmatcuk/doublestar v1.2.2
-	github.com/kr/pretty v0.1.0 // indirect
-	github.com/lyraproj/dgo v0.3.2
-	github.com/lyraproj/dgoyaml v0.3.1
-	github.com/lyraproj/hierasdk v0.3.0
+	github.com/lyraproj/dgo v0.4.1
+	github.com/lyraproj/dgoyaml v0.4.1
+	github.com/lyraproj/hierasdk v0.4.1
+	github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
 	github.com/sirupsen/logrus v1.4.2
-	github.com/spf13/cobra v0.0.5
-	github.com/stretchr/testify v1.4.0
-	golang.org/x/sys v0.0.0-20200117145432-59e60aa80a0c
-	gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
-	gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2
+	github.com/spf13/cobra v0.0.6
+	github.com/stretchr/testify v1.5.1
+	golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
+	gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
+	gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71
 )
 
 go 1.13
diff --git a/go.sum b/go.sum
index 8bfa7ca..97c116e 100644
--- a/go.sum
+++ b/go.sum
@@ -1,73 +1,162 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
+github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
 github.com/bmatcuk/doublestar v1.2.2 h1:oC24CykoSAB8zd7XgruHo33E0cHJf/WhQA/7BeXj+x0=
 github.com/bmatcuk/doublestar v1.2.2/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
+github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
 github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04=
 github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
-github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
 github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY=
 github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
-github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
+github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
+github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
+github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
+github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
+github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
+github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
 github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
 github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
+github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
 github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
 github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
 github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/lyraproj/dgo v0.3.2 h1:q9WS1cRdTKLw96RxgQ2anlWNqFK2A7OjMzTaAQb9Tfw=
-github.com/lyraproj/dgo v0.3.2/go.mod h1:O9r/qo0ktKMaYLVBAKModbBKAMCVZFhrkMClfmxdqB0=
-github.com/lyraproj/dgoyaml v0.3.1 h1:UL/54swmeNRhbNL3tqEYuoW987ky1ln7KypRQvB50iY=
-github.com/lyraproj/dgoyaml v0.3.1/go.mod h1:q/LG5RSDegYLko1PcAwl9H7gVUr3gKyijd7dW3QcVZ4=
-github.com/lyraproj/hierasdk v0.3.0 h1:FNkK79DvFreYHHpXNXTmBEuhyoBqmfSF1OsOVRsZdQo=
-github.com/lyraproj/hierasdk v0.3.0/go.mod h1:Kv/Y2kvdtBPy3NPOBI3FD2lGbgtLqQFAWL32uz2Tipk=
+github.com/lyraproj/dgo v0.4.1 h1:MZautCIx+vLs/36YGuvqRlVnyhm/cpBRj/GYvwfBDGQ=
+github.com/lyraproj/dgo v0.4.1/go.mod h1:O9r/qo0ktKMaYLVBAKModbBKAMCVZFhrkMClfmxdqB0=
+github.com/lyraproj/dgoyaml v0.4.1 h1:stve5yJoW0BJvnBWB+nPQsteiCYyQf78RBd5OHRHf/8=
+github.com/lyraproj/dgoyaml v0.4.1/go.mod h1:AjVghIx5qQ3XfGFd0nzspDuDtKHLeLzLuTMZt+YKq1A=
+github.com/lyraproj/hierasdk v0.4.1 h1:dTawjhVKv71CZ3SbcXMFBJ9fjSuyEw3v+s9zNVqzHmA=
+github.com/lyraproj/hierasdk v0.4.1/go.mod h1:TGH+oMdchYF2fOUMr5Olat+NP/YkXsnJFNV3imDxmXg=
 github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
+github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
 github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
 github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
 github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
+github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
+github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
 github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
+github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
+github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
+github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
+github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
+github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
+github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
+github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
+github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
 github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
+github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
 github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
 github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
-github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s=
-github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
+github.com/spf13/cobra v0.0.6 h1:breEStsVwemnKh2/s6gMvSdMEkwW0sK8vGStnlVBMCs=
+github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
 github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
 github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
 github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
-github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
+github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
-github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 h1:3SVOIvH7Ae1KRYyQWRjXWJEA9sS/c/pjvH++55Gr648=
-github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
+github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
+github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
+github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
+github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
 github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
-golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
-golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
-golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
+go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
+go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
+go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200117145432-59e60aa80a0c h1:gUYreENmqtjZb2brVfUas1sC6UivSY8XwKwPo8tloLs=
-golang.org/x/sys v0.0.0-20200117145432-59e60aa80a0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
+golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
+gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
+gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2 h1:XZx7nhd5GMaZpmDaEHFVafUZC7ya0fuo7cSJ3UCKYmM=
-gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71 h1:Xe2gvTZUJpsvOWUnvmL/tmhVBZUmHSvLbMjRj6NUUKo=
+gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/hiera/hiera.go b/hiera/hiera.go
index 93931ff..785adfb 100644
--- a/hiera/hiera.go
+++ b/hiera/hiera.go
@@ -207,7 +207,11 @@ func parseCommandLineValue(c api.Session, vs string) dgo.Value {
 	vs = strings.TrimSpace(vs)
 	for _, pfx := range needParsePrefix {
 		if strings.HasPrefix(vs, pfx) {
-			return typ.ExactValue(c.Dialect().ParseType(c.AliasMap(), vf.String(vs)))
+			var v dgo.Value
+			c.AliasMap().Collect(func(aa dgo.AliasAdder) {
+				v = typ.ExactValue(c.Dialect().ParseType(aa, vf.String(vs)))
+			})
+			return v
 		}
 	}
 	return vf.String(vs)
diff --git a/hiera/render.go b/hiera/render.go
index 9d2d457..fba22f7 100644
--- a/hiera/render.go
+++ b/hiera/render.go
@@ -29,33 +29,35 @@ const (
 
 // Render renders a value on a writer using a specified RenderName
 func Render(s api.Session, renderAs RenderName, value dgo.Value, out io.Writer) {
+	// Convert value to rich data format without references
+	dedupStream := func(value dgo.Value, consumer streamer.Consumer) {
+		opts := streamer.DefaultOptions()
+		opts.DedupLevel = streamer.NoDedup
+		ser := streamer.New(s.AliasMap(), opts)
+		ser.Stream(value, consumer)
+	}
+
 	switch renderAs {
 	case JSON:
 		if value.Equals(vf.Nil) {
 			util.WriteString(out, "null\n")
 		} else {
-			// Convert value to rich data format
-			opts := streamer.DefaultOptions()
-			opts.DedupLevel = streamer.NoDedup
-			ser := streamer.New(s.AliasMap(), opts)
-			ser.Stream(value, streamer.JSON(out))
+			dedupStream(value, streamer.JSON(out))
 			util.WriteByte(out, '\n')
 		}
 
 	case YAML:
 		if value.Equals(vf.Nil) {
 			util.WriteString(out, "\n")
+		} else {
+			dc := streamer.DataCollector()
+			dedupStream(value, dc)
+			bs, err := yaml.Marshal(dc.Value())
+			if err != nil {
+				panic(err)
+			}
+			util.WriteString(out, string(bs))
 		}
-		// Convert value to rich data format
-		ser := streamer.New(s.AliasMap(), streamer.DefaultOptions())
-		dc := streamer.DataCollector()
-		ser.Stream(value, dc)
-
-		bs, err := yaml.Marshal(dc.Value())
-		if err != nil {
-			panic(err)
-		}
-		util.WriteString(out, string(bs))
 	case Binary:
 		bi := vf.New(typ.Binary, value).(dgo.Binary)
 		_, err := out.Write(bi.GoBytes())
diff --git a/internal/datahashprovider.go b/internal/datahashprovider.go
index 1ffc6c8..e597774 100644
--- a/internal/datahashprovider.go
+++ b/internal/datahashprovider.go
@@ -107,7 +107,7 @@ func (dh *dataHashProvider) FullName() string {
 // NewDataHashProvider creates a new provider with a data_hash function configured from the given entry
 func NewDataHashProvider(he api.Entry) api.DataProvider {
 	ls := he.Locations()
-	return &dataHashProvider{hierarchyEntry: he, hashes: vf.MapWithCapacity(len(ls), nil)}
+	return &dataHashProvider{hierarchyEntry: he, hashes: vf.MapWithCapacity(len(ls))}
 }
 
 func optionsWithLocation(options dgo.Map, loc string) dgo.Map {
diff --git a/lookup/testdata/lookup_key_plugin.yaml b/lookup/testdata/lookup_key_plugin_hiera.yaml
similarity index 100%
rename from lookup/testdata/lookup_key_plugin.yaml
rename to lookup/testdata/lookup_key_plugin_hiera.yaml
diff --git a/lookup/testdata/panic_plugin.yaml b/lookup/testdata/panic_plugin_hiera.yaml
similarity index 100%
rename from lookup/testdata/panic_plugin.yaml
rename to lookup/testdata/panic_plugin_hiera.yaml
diff --git a/lookup/testdata/refuse_to_die_plugin.yaml b/lookup/testdata/refuse_to_die_plugin_hiera.yaml
similarity index 100%
rename from lookup/testdata/refuse_to_die_plugin.yaml
rename to lookup/testdata/refuse_to_die_plugin_hiera.yaml
diff --git a/lookup/testdata/with_custom_provider.yaml b/lookup/testdata/with_custom_provider_hiera.yaml
similarity index 100%
rename from lookup/testdata/with_custom_provider.yaml
rename to lookup/testdata/with_custom_provider_hiera.yaml
diff --git a/merge/deepmerge.go b/merge/deepmerge.go
index 4cb656a..ec1142c 100644
--- a/merge/deepmerge.go
+++ b/merge/deepmerge.go
@@ -26,7 +26,7 @@ func deep(a, b dgo.Value, options dgo.Map) (dgo.Value, bool) {
 	switch a := a.(type) {
 	case dgo.Map:
 		if hb, ok := b.(dgo.Map); ok {
-			es := vf.MapWithCapacity(a.Len()+hb.Len(), nil)
+			es := vf.MapWithCapacity(a.Len() + hb.Len())
 			a.EachEntry(func(e dgo.MapEntry) {
 				if bv := hb.Get(e.Key()); bv != nil {
 					if m, mh := deep(e.Value(), bv, options); mh {
diff --git a/provider/environment.go b/provider/environment.go
index 7db1d23..7f02a3a 100644
--- a/provider/environment.go
+++ b/provider/environment.go
@@ -16,7 +16,7 @@ import (
 func Environment(_ hiera.ProviderContext, key string) dgo.Value {
 	if key == `env` {
 		env := os.Environ()
-		em := vf.MapWithCapacity(len(env), nil)
+		em := vf.MapWithCapacity(len(env))
 		for _, ev := range env {
 			if ei := strings.IndexRune(ev, '='); ei > 0 {
 				em.Put(ev[:ei], ev[ei+1:])
diff --git a/session/interpolate.go b/session/interpolate.go
index ec65b39..565b8c7 100644
--- a/session/interpolate.go
+++ b/session/interpolate.go
@@ -49,7 +49,7 @@ func (ic *ivContext) doInterpolate(value dgo.Value, allowMethods bool) (dgo.Valu
 		return a, changed
 	}
 	if h, ok := value.(dgo.Map); ok {
-		cp := vf.MapWithCapacity((h.Len()*4)/3, nil)
+		cp := vf.MapWithCapacity(h.Len())
 		changed := false
 		h.EachEntry(func(e dgo.MapEntry) {
 			k, kc := ic.doInterpolate(e.Key(), allowMethods)
diff --git a/session/invocation.go b/session/invocation.go
index c0923e4..78b2608 100644
--- a/session/invocation.go
+++ b/session/invocation.go
@@ -147,7 +147,9 @@ func (ic *ivContext) extractConversion() (convertToType dgo.Type, convertToArgs
 		ts = ct
 	}
 	if ts != nil {
-		convertToType = ic.Dialect().ParseType(ic.AliasMap(), ts.(dgo.String))
+		ic.AliasMap().Collect(func(aa dgo.AliasAdder) {
+			convertToType = ic.Dialect().ParseType(aa, ts.(dgo.String))
+		})
 	}
 	return
 }
diff --git a/session/session.go b/session/session.go
index f539235..2ee9d34 100644
--- a/session/session.go
+++ b/session/session.go
@@ -96,7 +96,7 @@ func New(parent context.Context, topProvider hiera.LookupKey, oif interface{}, l
 		hieraSessionOptionsKey:   options,
 		hieraPluginRegistry:      &pluginRegistry{}}
 
-	s := &session{Context: parent, aliasMap: tf.NewAliasMap(), vars: vars, dialect: dialect, scope: scope}
+	s := &session{Context: parent, aliasMap: tf.DefaultAliases(), vars: vars, dialect: dialect, scope: scope}
 	s.loader = s.newHieraLoader(ldr)
 	return s
 }


Test patch:
diff --git a/lookup/lookup_test.go b/lookup/lookup_test.go
index 9b8484b..fb4e503 100644
--- a/lookup/lookup_test.go
+++ b/lookup/lookup_test.go
@@ -101,7 +101,7 @@ func TestLookup_var_interpolated_config(t *testing.T) {
 
 func TestLookup_fact_directly(t *testing.T) {
 	inTestdata(func() {
-		result, err := cli.ExecuteLookup(`--facts`, `facts.yaml`, `--config`, `fact_directly.yaml`, `the_fact`)
+		result, err := cli.ExecuteLookup(`--facts`, `facts.yaml`, `--config`, `fact_directly_hiera.yaml`, `the_fact`)
 		require.NoError(t, err)
 		require.Equal(t, "value of the_fact\n", string(result))
 	})
@@ -117,7 +117,7 @@ func TestLookup_nullentry(t *testing.T) {
 
 func TestLookup_emptyMap(t *testing.T) {
 	inTestdata(func() {
-		result, err := cli.ExecuteLookup(`--config`, `empty_map.yaml`, `--render-as`, `json`, `empty_map`)
+		result, err := cli.ExecuteLookup(`--config`, `empty_map_hiera.yaml`, `--render-as`, `json`, `empty_map`)
 		require.NoError(t, err)
 		require.Equal(t, "{}\n", string(result))
 	})
@@ -125,7 +125,7 @@ func TestLookup_emptyMap(t *testing.T) {
 
 func TestLookup_emptySubMap(t *testing.T) {
 	inTestdata(func() {
-		result, err := cli.ExecuteLookup(`--config`, `empty_map.yaml`, `--render-as`, `json`, `empty_sub_map`)
+		result, err := cli.ExecuteLookup(`--config`, `empty_map_hiera.yaml`, `--render-as`, `json`, `empty_sub_map`)
 		require.NoError(t, err)
 		require.Equal(t, "{\"x\":\"the x\",\"empty\":{}}\n", string(result))
 	})
@@ -133,7 +133,7 @@ func TestLookup_emptySubMap(t *testing.T) {
 
 func TestLookup_emptySubMapInArray(t *testing.T) {
 	inTestdata(func() {
-		result, err := cli.ExecuteLookup(`--config`, `empty_map.yaml`, `--render-as`, `json`, `empty_sub_map_in_array`)
+		result, err := cli.ExecuteLookup(`--config`, `empty_map_hiera.yaml`, `--render-as`, `json`, `empty_sub_map_in_array`)
 		require.NoError(t, err)
 		require.Equal(t, "[{}]\n", string(result))
 	})
@@ -152,6 +152,34 @@ func TestLookup_sensitive(t *testing.T) {
 	})
 }
 
+func TestLookup_renderJSON_NoDedup(t *testing.T) {
+	inTestdata(func() {
+		result, err := cli.ExecuteLookup(`non-existent`, `--dialect`, `dgo`, `--default`,
+			`{ x: "a string longer than 20 characters in length", y: "a string longer than 20 characters in length" }`,
+			`--render-as`, `json`)
+
+		require.NoError(t, err)
+		require.Equal(t,
+			`{"x":"a string longer than 20 characters in length","y":"a string longer than 20 characters in length"}
+`,
+			string(result))
+	})
+}
+
+func TestLookup_renderYAML_NoDedup(t *testing.T) {
+	inTestdata(func() {
+		result, err := cli.ExecuteLookup(`non-existent`, `--dialect`, `dgo`, `--default`,
+			`{ x: "a string longer than 20 characters in length", y: "a string longer than 20 characters in length" }`,
+			`--render-as`, `yaml`)
+
+		require.NoError(t, err)
+		require.Equal(t, `x: a string longer than 20 characters in length
+y: a string longer than 20 characters in length
+`,
+			string(result))
+	})
+}
+
 func TestLookup_lookup(t *testing.T) {
 	inTestdata(func() {
 		result, err := cli.ExecuteLookup(`lookup_array`)
@@ -377,7 +405,7 @@ Searching for "hash"
 func TestLookupKey_plugin(t *testing.T) {
 	ensureTestPlugin(t)
 	inTestdata(func() {
-		result, err := cli.ExecuteLookup(`--config`, `lookup_key_plugin.yaml`, `a`)
+		result, err := cli.ExecuteLookup(`--config`, `lookup_key_plugin_hiera.yaml`, `a`)
 		require.NoError(t, err)
 		require.Equal(t, "option a\n", string(result))
 	})
@@ -386,16 +414,31 @@ func TestLookupKey_plugin(t *testing.T) {
 func TestDataHash_plugin(t *testing.T) {
 	ensureTestPlugin(t)
 	inTestdata(func() {
-		result, err := cli.ExecuteLookup(`--config`, `data_hash_plugin.yaml`, `d`)
+		result, err := cli.ExecuteLookup(`--config`, `data_hash_plugin_hiera.yaml`, `d`)
 		require.NoError(t, err)
 		require.Equal(t, "interpolate c is value c\n", string(result))
 	})
 }
 
+func TestLookup_issue75(t *testing.T) {
+	ensureTestPlugin(t)
+	for i := 0; i < 100; i++ {
+		inTestdata(func() {
+			result, err := cli.ExecuteLookup(`dns_resource_group_name`, `--config`, `dedup_hiera.yaml`, `--dialect`, `dgo`,
+				`--render-as`, `yaml`)
+
+			require.NoError(t, err)
+			require.Equal(t, `cbuk-shared-sharedproduction-dns-uksouth
+`,
+				string(result))
+		})
+	}
+}
+
 func TestDataHash_refuseToDie(t *testing.T) {
 	ensureTestPlugin(t)
 	inTestdata(func() {
-		_, err := cli.ExecuteLookup(`--config`, `refuse_to_die_plugin.yaml`, `a`)
+		_, err := cli.ExecuteLookup(`--config`, `refuse_to_die_plugin_hiera.yaml`, `a`)
 		if assert.Error(t, err) {
 			require.Regexp(t, `net/http: request canceled`, err.Error())
 		}
@@ -405,7 +448,7 @@ func TestDataHash_refuseToDie(t *testing.T) {
 func TestDataHash_panic(t *testing.T) {
 	ensureTestPlugin(t)
 	inTestdata(func() {
-		_, err := cli.ExecuteLookup(`--config`, `panic_plugin.yaml`, `a`)
+		_, err := cli.ExecuteLookup(`--config`, `panic_plugin_hiera.yaml`, `a`)
 		if assert.Error(t, err) {
 			require.Regexp(t, `500 Internal Server Error: dit dit dit daah daah daah dit dit dit`, err.Error())
 		}
diff --git a/lookup/testdata/data_hash_plugin.yaml b/lookup/testdata/data_hash_plugin_hiera.yaml
similarity index 100%
rename from lookup/testdata/data_hash_plugin.yaml
rename to lookup/testdata/data_hash_plugin_hiera.yaml
diff --git a/lookup/testdata/dedup/first.yaml b/lookup/testdata/dedup/first.yaml
new file mode 100644
index 0000000..81ac262
--- /dev/null
+++ b/lookup/testdata/dedup/first.yaml
@@ -0,0 +1,2 @@
+root:
+  dns_resource_group_name: cbuk-shared-sharedproduction-dns-uksouth
diff --git a/lookup/testdata/dedup/second.yaml b/lookup/testdata/dedup/second.yaml
new file mode 100644
index 0000000..3b8a380
--- /dev/null
+++ b/lookup/testdata/dedup/second.yaml
@@ -0,0 +1,1 @@
+dns_resource_group_name: "%{strict_alias('root.dns_resource_group_name')}"
\ No newline at end of file
diff --git a/lookup/testdata/dedup_hiera.yaml b/lookup/testdata/dedup_hiera.yaml
new file mode 100644
index 0000000..14efc60
--- /dev/null
+++ b/lookup/testdata/dedup_hiera.yaml
@@ -0,0 +1,9 @@
+version: 5
+defaults:
+  datadir: dedup
+hierarchy:
+  - name: first
+    data_hash: test_tf_simulation
+    pluginfile: hieratestplugin
+  - name: second
+    path: second.yaml
\ No newline at end of file
diff --git a/lookup/testdata/empty_map.yaml b/lookup/testdata/empty_map_hiera.yaml
similarity index 100%
rename from lookup/testdata/empty_map.yaml
rename to lookup/testdata/empty_map_hiera.yaml
diff --git a/lookup/testdata/fact_directly.yaml b/lookup/testdata/fact_directly_hiera.yaml
similarity index 100%
rename from lookup/testdata/fact_directly.yaml
rename to lookup/testdata/fact_directly_hiera.yaml
diff --git a/lookup/testdata/hieratestplugin/hieratestplugin.go b/lookup/testdata/hieratestplugin/hieratestplugin.go
index 6371d42..d5b0aa3 100644
--- a/lookup/testdata/hieratestplugin/hieratestplugin.go
+++ b/lookup/testdata/hieratestplugin/hieratestplugin.go
@@ -1,6 +1,7 @@
 package main
 
 import (
+	"encoding/json"
 	"errors"
 
 	"github.com/lyraproj/dgo/vf"
@@ -16,6 +17,7 @@ func main() {
 	register.DataHash(`test_data_hash`, sampleHash)
 	register.DataHash(`test_refuse_to_die`, refuseToDie)
 	register.DataHash(`test_panic`, panicAttack)
+	register.DataHash(`test_tf_simulation`, tfSimulation)
 	plugin.ServeAndExit()
 }
 
@@ -43,3 +45,42 @@ func refuseToDie(c hiera.ProviderContext) dgo.Map {
 func panicAttack(c hiera.ProviderContext) dgo.Map {
 	panic(errors.New(`dit dit dit daah daah daah dit dit dit`))
 }
+
+func tfSimulation(c hiera.ProviderContext) dgo.Map {
+	var state map[string]interface{}
+	err := json.Unmarshal([]byte(`{
+    "dns_resource_group_name": "cbuk-shared-sharedproduction-dns-uksouth",
+    "dns_zones": {
+			"cbinnovation.uk": {
+        "id": "/subscriptions/xxx/resourceGroups/cbuk-shared-sharedproduction-dns-uksouth/providers/Microsoft.Network/dnszones/cbinnovation.uk",
+        "max_number_of_record_sets": 10000,
+        "name": "cbinnovation.uk",
+        "name_servers": [
+          "ns1-04.azure-dns.com.",
+          "ns2-04.azure-dns.net.",
+          "ns3-04.azure-dns.org.",
+          "ns4-04.azure-dns.info."
+        ],
+        "number_of_record_sets": 2,
+        "registration_virtual_network_ids": null,
+        "resolution_virtual_network_ids": null,
+        "resource_group_name": "cbuk-shared-sharedproduction-dns-uksouth",
+        "tags": {
+          "environment": "sharedproduction",
+          "organisation": "cbuk",
+          "system": "shared",
+          "technology": "dns"
+        },
+        "zone_type": "Public"
+      }
+    }
+  }`), &state)
+	if err != nil {
+		panic(err)
+	}
+	v := vf.MutableMap()
+	for k, os := range state {
+		v.Put(k, os)
+	}
+	return vf.Map(`root`, v)
+}