Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Basic manifest implementation #4

Merged
merged 7 commits into from
Oct 18, 2016
Merged

Basic manifest implementation #4

merged 7 commits into from
Oct 18, 2016

Conversation

sdboyer
Copy link
Member

@sdboyer sdboyer commented Oct 18, 2016

Can merge this now (or discuss), and I'm now continuing on to the lock

@sdboyer
Copy link
Member Author

sdboyer commented Oct 18, 2016

Oh and yes, it's sloppy. I also don't like packages named types - super happy to go with another suggestion. Just did that for expediency - separate package seems worth it on the expectation that the manifest/lock file implementations are something that other people are likely going to want to reuse

@@ -0,0 +1,113 @@
package types
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a copyright header as per the other files

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}

func (m *Manifest) TestDependencyConstraints() gps.ProjectConstraints {
// We're not dealing with this (yet?)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: deal with this

@@ -0,0 +1,94 @@
package types
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyright

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}

func toProps(n string, p possibleProps) (pp gps.ProjectProperties, err error) {
if p.Branch != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to use switches for these kinds of if/else constructs, but up to you

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i was on the fence. i went with this because the successively narrowing checks fit better in my mind with ifs - i always have to quietly remind myself that switches DO evaluate the branches in declaration order


m2, err := ReadManifest(strings.NewReader(jg))
if err != nil {
t.Errorf("Should have read Manifest correctly, but got err %q", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fatalf

@adg
Copy link
Contributor

adg commented Oct 18, 2016

Oh I didn't notice it was in a separate package. Just put it all in package main for now. Thanks!

@sdboyer
Copy link
Member Author

sdboyer commented Oct 18, 2016

Yeah, I did that at first, but then split it out because, afaik, Alan's sockpuppet died on the vine, so there's no tool to extract symbols into their own package. Which means it's still a bit of a PITA to do that particular refactor later.

Is your preference for single-pkg just to keep things simpler for now, or is there a specific policy at play?

@adg
Copy link
Contributor

adg commented Oct 18, 2016

It's just a simplicity thing. Especially since we don't have a good package
name. That's a strong signal to keep things together, for now.`

On 18 October 2016 at 14:45, sam boyer notifications@github.com wrote:

Yeah, I did that at first, but then split it out because, afaik, Alan's
sockpuppet died on the vine, so there's no tool to extract symbols into
their own package. Which means it's still a bit of a PITA to do that
particular refactor later.

Is your preference for single-pkg just to keep things simpler for now, or
is there a specific policy at play?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#4 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AIDilVfgZzxM_tmJhNoYW43EBHUjAIUnks5q1EDXgaJpZM4KZV4j
.

@sdboyer
Copy link
Member Author

sdboyer commented Oct 18, 2016

kk, fair enough

@adg
Copy link
Contributor

adg commented Oct 18, 2016

Looks good.

@adg adg merged commit 095637b into golang:master Oct 18, 2016
@sdboyer sdboyer deleted the manifest-and-lock branch October 18, 2016 04:07
zbintliff added a commit to zbintliff/dep that referenced this pull request Mar 3, 2017
* Basic first pass at JSON-based manifest

* Add rudimentary ReadManifest() tests

* Implement gps.RootManifest methods on Manifest

* Add copyright headers

* Fatalf on test that invalidates later checks

* Rewrite TestDependencyConstraints comment as TODO

* Consolidate types package back into main
krisnova pushed a commit to krisnova/dep that referenced this pull request Apr 21, 2017
* Basic first pass at JSON-based manifest

* Add rudimentary ReadManifest() tests

* Implement gps.RootManifest methods on Manifest

* Add copyright headers

* Fatalf on test that invalidates later checks

* Rewrite TestDependencyConstraints comment as TODO

* Consolidate types package back into main
ibrasho pushed a commit to ibrasho-forks/dep that referenced this pull request May 10, 2017
* Basic first pass at JSON-based manifest

* Add rudimentary ReadManifest() tests

* Implement gps.RootManifest methods on Manifest

* Add copyright headers

* Fatalf on test that invalidates later checks

* Rewrite TestDependencyConstraints comment as TODO

* Consolidate types package back into main
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants