Skip to content

cos418atPrinceton/assignments_template

Repository files navigation

Assignments for COS 418

Environment Setup

Teaching support is only provided for work done using the cycles or courselab servers. The tests are known to work under Go 1.13. Thus later version 1 releases should also work. Learn more about semantic versioning here. Please follow these instructions for requesting access to the servers if you have not already done so.

Tools

There are many commonly used tools in the Go ecosystem. The three most useful starting out are: Go fmt and Go vet, which are built-ins, and Golint, which is similar to the splint tool you used in COS217.

Editors

For those of you in touch with your systems side (this is Distributed Systems, after all), there are quite a few resources for Go development in both emacs (additional information available here) and vim (additional resources here).

As many Princeton COS students have become attached to Sublime, here are the two indispensible Sublime packages for Go development: GoSublime and Sublime-Build. And -- learning from the ancient emacs-vi holy war -- it would be inviting trouble to offer Sublime information without likewise dispensing the must-have Atom plugin: Go-Plus (walkthrough and additional info here).

Coding Style

All of the code you turn in for this course should have good style. Make sure that your code has proper indentation, descriptive comments, and a comment header at the beginning of each file, which includes your name, userid, and a description of the file.

It is recommended to use the standard tools gofmt and go vet. You can also use the Go Checkstyle tool for advice on how to improve your code's style. It would also be advisable to produce code that complies with Golint where possible.

How do I git?

Please read this Git Tutorial.

The basic git workflow in the shell (assuming you already have a repo set up):

  • git pull
  • do some work
  • git status (shows what has changed)
  • git add all files you want to commit
  • git commit -m "brief message on your update"
  • git push

All programming assignments, require Git for submission.

We are using Github for distributing and collecting your assignments. At the time of seeing this, you should have already joined the cos418 github classroom---which will automatically fork your private repository. Your Github page should have a link. Normally, you only need to clone the repository once, and you will have everything you need for all the assignments in this class.

$ git clone https://github.com/cos418s24/assignments-template-YourNameHere
$ ls
assignment1-1  assignment1-2  assignment1-3  assignment2  assignment3  assignment4  assignment5  README.md  setup.md
$ 

Now, you have everything you need for doing all assignments, i.e., instructions and starter code. Git allows you to keep track of the changes you make to the code. For example, if you want to checkpoint your progress, you can commit your changes by running:

$ git commit -am 'partial solution to assignment 1-1'
$ 

You should do this early and often! You can push your changes to Github after you commit with:

$ git push origin master
$ 

Please let us know that you've gotten this far in the assignment, by pushing a tag to Github.

$ git tag -a -m "i got git and cloned the assignments" gotgit
$ git push origin gotgit
$

As you complete parts of the assignments (and begin future assignments) we'll ask you push tags. You should also be committing and pushing your progress regularly.

Stepping into Assignment 1-1

Now it's time to go to the assignment 1-1 folder to begin your adventure!