mirror of
https://github.com/majd/ipatool
synced 2026-11-26 09:17:52 +08:00
- Move logging to command level. - Simplify and unify interfaces for `appstore` package. - Move sinf replication from "Download" API to "ReplicateSinf" API. - Handle retries and command specific logic in the command level. - Rename "Info" API to "AccountInfo".
25 lines
389 B
Go
25 lines
389 B
Go
package util
|
|
|
|
import "errors"
|
|
|
|
type Pair[T, U any] struct {
|
|
First T
|
|
Second U
|
|
}
|
|
|
|
func Zip[T, U any](ts []T, us []U) ([]Pair[T, U], error) {
|
|
if len(ts) != len(us) {
|
|
return nil, errors.New("slices have different lengths")
|
|
}
|
|
|
|
pairs := make([]Pair[T, U], len(ts))
|
|
for i := 0; i < len(ts); i++ {
|
|
pairs[i] = Pair[T, U]{
|
|
First: ts[i],
|
|
Second: us[i],
|
|
}
|
|
}
|
|
|
|
return pairs, nil
|
|
}
|