|
|
|
|
|
by Jtsummers
165 days ago
|
|
I'm not familiar with Swift's libraries, but what's the point of making this two lines instead of one: let request = URLRequest(url: url)
let (data, response) = try await URLSession.shared.data(for: request)
// vs
let (data, response) = try await URLSession.shared.data(from: url)
That aside, your Swift version is still about half the size of the Go version with similar levels of error handling. |
|
The second one is for downloading directly from a URL and I've never seen it used outside of examples in blog posts on the internet.