I have a go package that has the following struct:
package transforms type MqttConfig struct { Qos byte } type KeyCertPair struct { KeyFile string } In my main.go, I import the package and use both of them liek this:
import ( sdkTransforms "github.com/edgexfoundry/app-functions-sdk-go/pkg/transforms") type AWSMQTTConfig struct { MQTTConfig *sdkTransforms.MqttConfig KeyCertPair *sdkTransforms.KeyCertPair } config := AWSMQTTConfig{} //FIRST pair := &sdkTransforms.KeyCertPair{ KeyFile: mqttKey, } //SECOND mqttcfg := &sdkTransforms.MqttConfig{ Qos: 2, } But only the second usage gives me this compile error:
unknown field 'Qos' in struct literal of type transforms.MqttConfig I don't understand what's wrong.
AWSMQTTConfigstruct,MqttConfigandKeyCertPairare NOT embedded. But the error you shared in your question concernstransforms.MqttConfig, a different struct. Can you share the structure the error references ?