package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/route53"
)
func main() {
sess := session.Must(session.NewSession())
client := route53.New(sess)
zones, err := client.ListHostedZones(&route53.ListHostedZonesInput{
MaxItems: aws.String("100"),
})
if err != nil {
fmt.Printf("Error occurred")
}
fmt.Printf("%v", zones)
if zones.IsTruncated {
fmt.Printf("%v", zones.NextMarker)
}
}
The code above fails due to the following condition.
if zones.IsTruncated {
fmt.Printf("%v", zones.NextMarker)
}
with the result of
non-bool zones.IsTruncated (type *bool) used as if condition
What I want to know is why is there a difference between a regular type(bool) and type(*bool). I understand one is a pointer value however, the condition should still be useful.
Here is a tailed snippet of the output without the condition in place
IsTruncated: true,
MaxItems: "100",
NextMarker: "Wouldn'tYouLikeToKnow"
}
bool
that istrue
how would you check that in a condition.