You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/04/22 17:47:33 UTC

[GitHub] [mynewt-newt] ccollins476ad commented on a change in pull request #389: INSTALLING.md fix

ccollins476ad commented on a change in pull request #389:
URL: https://github.com/apache/mynewt-newt/pull/389#discussion_r413189852



##########
File path: INSTALLING.md
##########
@@ -25,12 +25,13 @@ following path, relative to the source directory:
 If you do not wish to run the included script, you can build newt manually with Go as follows (executed from the source directory):
 
 ```no-highlight
-    $ mkdir "$GOPATH"/src/mynewt.apache.org
-    $ cp -r * "$GOPATH"/src/mynewt.apache.org     # Or untar to this path
-    $ go install mynewt.apache.org/newt/newt
+    $ cd "$GOPATH"/src/
+    $ git clone https://github.com/apache/mynewt-newt
+    $ cd mynewt-newt/newt
+    $ go get
 ```
 
-This puts the newt binary in $GOPATH/bin
+This builds the newt from repository and installs it in the system.

Review comment:
       `go get` builds the specified package and puts the binary in `$GOPATH/bin`.  E.g.,
   ```
   [ccollins@ccollins:~]$ go version
   go version go1.14.1 darwin/amd64
   [ccollins@ccollins:~]$ newt version
   -bash: newt: command not found
   [ccollins@ccollins:~]$ go get mynewt.apache.org/newt/newt
   go: found mynewt.apache.org/newt/newt in mynewt.apache.org/newt v0.0.0-20200409145402-c5d1e422bfa3
   [ccollins@ccollins:~]$ newt version
   Apache Newt 1.9.0-dev / unknown / unknown
   [ccollins@ccollins:~]$ which newt
   /Users/ccollins/go/bin/newt
   ```
   
   `go get` behaves slightly differently depending on what directory you run it from.  The command always downloads the package's dependencies and builds the package.  But if you run the command from within the directory of a go package, the command *additionally* adds the specified package to the current package's dependency list (i.e., it modifies `go.mod` and `go.sum`).  I really wish they hadn't overloaded `go get` in this way. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org