Example Go package built into an XCFramework for Swift Package Manager, targeting iOS, macOS, and macCatalyst targets.
This package implements a simple API to fetch a URL using an HTTP GET
request and return the response bytes.
var error: NSErrorPointer = nil
guard let response = GoGet("https://golang.org/", error) else {
XCTFail("response == nil")
return
}
guard error == nil else {
return
}
guard let str = String(data: response, encoding: .utf8) else {
return
}
Go 1.16, Swift 5.3, and Xcode 11 or later.
To build the XCFramework and Swift package: make build
To test: make test
© Alta Software, LLC