| 123 | } |
| 124 | |
| 125 | func (l *lockfile) Resolve(pkg string) (*lock.Package, error) { |
| 126 | switch { |
| 127 | case strings.Contains(pkg, "path:"): |
| 128 | return &lock.Package{Resolved: pkg}, nil |
| 129 | case strings.Contains(pkg, "github:"): |
| 130 | return &lock.Package{Resolved: pkg}, nil |
| 131 | default: |
| 132 | return &lock.Package{ |
| 133 | Resolved: flake.Installable{ |
| 134 | Ref: l.Stdenv(), |
| 135 | AttrPath: pkg, |
| 136 | }.String(), |
| 137 | }, nil |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | func testInputFromString(s, projectDir string) *testInput { |
| 142 | return lo.ToPtr(testInput{Package: PackageFromStringWithDefaults(s, &lockfile{projectDir})}) |