code: func (m *FakeMetadata) GetMetadata(key string) (string, error) {
  	networkInterfacesPrefix := "network/interfaces/macs/"
  	i := m.aws.selfInstance
  	if key == "placement/availability-zone" {
  		az := ""
  		if i.Placement != nil {
  			az = aws.StringValue(i.Placement.AvailabilityZone)
  		}
  		return az, nil
  	} else if key == "instance-id" {
  		return aws.StringValue(i.InstanceId), nil
  	} else if key == "local-hostname" {
  		return aws.StringValue(i.PrivateDnsName), nil
  	} else if key == "public-hostname" {
  		return aws.StringValue(i.PublicDnsName), nil
  	} else if key == "local-ipv4" {
  		return aws.StringValue(i.PrivateIpAddress), nil
  	} else if key == "public-ipv4" {
  		return aws.StringValue(i.PublicIpAddress), nil
  	} else if strings.HasPrefix(key, networkInterfacesPrefix) {
  		if key == networkInterfacesPrefix {
  			return strings.Join(m.aws.networkInterfacesMacs, "/\n") + "/\n", nil
  		}
  
  		keySplit := strings.Split(key, "/")
  		macParam := keySplit[3]
  		if len(keySplit) == 5 && keySplit[4] == "vpc-id" {
  			for i, macElem := range m.aws.networkInterfacesMacs {
  				if macParam == macElem {
  					return m.aws.networkInterfacesVpcIDs[i], nil
  				}
  			}
  		}
  		if len(keySplit) == 5 && keySplit[4] == "local-ipv4s" {
  			for i, macElem := range m.aws.networkInterfacesMacs {
  				if macParam == macElem {
  					return strings.Join(m.aws.networkInterfacesPrivateIPs[i], "/\n"), nil
  				}
  			}
  		}
  
  		return "", nil
  	}
  
  	return "", nil
  }
docs: // GetMetadata returns fake EC2 metadata for testing