code: func (p11w *Pkcs11Wrapper) ListObjects(template []*pkcs11.Attribute, max int) {
  
  	// do an object search
  	objects, _, err := p11w.FindObjects(template, max)
  
  	if err != nil {
  		fmt.Println("Could not find any objects:", err)
  	} else {
  
  		// prepare table headers
  		table := tablewriter.NewWriter(os.Stdout)
  		table.SetHeader([]string{"COUNT", "CKA_CLASS", "CKA_LABEL", "CKA_ID"})
  		table.SetCaption(true, fmt.Sprintf("Total objects found (max %d): %d", max, len(objects)))
  
  		// populate table data
  		for i, k := range objects {
  			al, err := p11w.Context.GetAttributeValue(
  				p11w.Session,
  				k,
  				[]*pkcs11.Attribute{
  					pkcs11.NewAttribute(pkcs11.CKA_LABEL, nil),
  					pkcs11.NewAttribute(pkcs11.CKA_ID, nil),
  					pkcs11.NewAttribute(pkcs11.CKA_CLASS, nil),
  				},
  			)
  
  			if err != nil {
  				panic(err)
  			}
  			table.Append(
  				[]string{
  					fmt.Sprintf("%03d", i+1),
  					DecodeCKACLASS(al[2].Value[0]),
  					fmt.Sprintf("%s", al[0].Value),
  					fmt.Sprintf("%x", al[1].Value),
  				},
  			)
  		}
  
  		// render table
  		table.Render()
  
  	}
  }
docs: // List content of slot