If I have the following golang code
```
package sdk
type Person struct { }
func (p *Person) GetName() (string, error) {
    return "", errors.New("...")
}
```

When I package it as xcframwork, its header file will probably look like 
this
```
*@interface* SdkPerson : NSObject <goSeqRefInterface> {}
// .......
- (NSString* *_Nonnull*)getName:(NSError* *_Nullable** *_Nullable*)error;
@end
```

Then when I call this method in swift I will have to write
```
*var* error: NSError? = *nil*
*let name = person.getName(&error)*
*if let error = error {*
*    throw error*
*}*
```

But if we can modify the return value of string to Nullable
`- (NSString* *_Nullable*)getName:(NSError* *_Nullable** *_Nullable*)error;`

Then it will be much easier to write swift code
```
let name = try person.getName()
```
We will write three less lines of code

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/94c5bdc3-b54d-49a9-a661-b7f15b750c5fn%40googlegroups.com.

Reply via email to