How to set a struct member that is a pointer to a string using reflection in Go
问题 I am trying to use reflection to set a pointer. elasticbeanstalk.CreateEnvironmentInput has a field SolutionStackName which is of type *string . I am getting the following error when I try to set any value: panic: reflect: call of reflect.Value.SetPointer on ptr Value Here is my code: ... newEnvCnf := new(elasticbeanstalk.CreateEnvironmentInput) checkConfig2(newEnvCnf, "SolutionStackName", "teststring") ... func checkConfig2(cnf interface{}, key string, value string) bool { log.Infof("key %v,