Giter Site home page Giter Site logo

gostart's Issues

mention "dep" (golang/dep, not godep)

I am starting with go and I ended up on this page

I was surprised by the lack of an official dependency management tool, but after I complained on twitter, people recommended "dep" to me, and it seems very sane and semi-official.

It should be mentioned here! This is one of the pages one will find when googling around about go ecosystem.

Do I need to have go files in the source folder?

Two things keep puzzling me:

  • do I need to have go files in the root folder (makes polluted github welcome pages)
  • and how to I compile/ where do I put commands (i.e. with main package) that use other packages that are part of the repo?

Also go dep might deserve mentioning as it does seem to support package versions?

"Problems with the current Go way" is more ranty than helpful :)

I think it'd probably be better to extract the points from that section into FAQ entries, and/or convert that section to pointers into the FAQ


Here's an attempt at breaking that section apart into FAQ entries:

Go tool doesn't do everything

Coming from other languages/environments, you may expect that go is a full on package management solution. It isn't! The following FAQ entries might be useful:

FAQ

...

How do I manage package versions?

There is no widely adopted solution for package version management, currently. The go tool has no knowledge of package versions; though it does choose package versions (vcs tags) based on your current go version.

The currently accepted approach is to build all of your dependencies off of master. Running go get -u ./... to update your locally cached dependencies is helpful to stay out of trouble, though not ideal.

Before you get up in arms and race off to write your own package version manager, be sure to read through discussion of the previous attempts at this:

How do I freeze packages when deploying?

go tool does not provide any way to create a reproducible environment for fool-proof deployments.

If you tested your code locally, you can never be sure that it'll work during your next deploy, because one of the dependencies might introduce a breaking change during the time period between your testing and deployment.

The only apparent solution to this is to package up your downloaded dependencies and copy them over to your production environment. Manually. You might find goven useful to automate this.

Need sub.go codes

In "The Go way" section, IMHO we need to reveal sub.go to ease the understanding how the sub.go 'template' works.

Problems with the current Go way inaccurate.

Deployments to production in most cases (appengine is a weird exception) are by compiling and then copying the statically linked binary to your production servers. Making deployment trivial.

no freedom to write go code anywhere in your file system

  • You can write go code anywhere in your file system. What you can't do is import code from anywhere in your file system. since all imports are relative to GOPATH. I have lots of short programs written in Go all over my filesystem that I run with 'go run'

no support for setting up a reproducible development environment or packaging a locally set up environment

  • Reproducing a development environment is as simple as tar'ing up your GOPATH and copying it to where ever you want.

URL-ish looking imports in your code
urls are unique and hierarchical. This makes them ideal for representing namespaces and giving every package a unique name while avoiding the issue of having to bless certain people with the ability to use certain names. eg. cpan, pypi, rubygems.

go has the best package versioning...

this addresses "15. How do I manage package versions?"

this is something that's driving me mad, how is nobody seeing the most simplest solution?
go lets you import an arbitrary path (which sort of works like a url) which specifies exactly what you want, there is no need for vcs specific bullshit like tags or branches...

you just use a vcs agnostic approach of placing a copy of each stable version of the package into a separate directory, while having a special one for development, and if you have some large assets that are mostly same for each version you just have that in root of repo and reuse it every version, so structure would look like this:

my_package
| - dev
| - v1
| - v2

this way you would have literal vcs agnostic version branches...
and you would import by just doing import "example.com/my_package/v2"
why does nobody use this?

...it's best because it's simple and it works and requires no specific vcs knowledge...

also if you think that this wastes space and duplicates too much code, then current solution of using vendoring is far worse as every package that uses some popular package would have a copy of it duplicating it many times over...

"package not found "

golang issue

Kindly help me solve this problem. When I import links it gives this error but when I downloaded data for the links it solves the error. but I have so many links that it will take so much time to download all the data and put it in the "src" folder of go lang.Is there anyway to access links in go language?

cannot build on Windows

Go lang 1.14 on Windows 10 x64

Error --

server\server.go:6:2: no Go files in c:\go\src\blocky\docs

I'm a Go lang newb so not sure what to do from here.

License missing

This file is notably missing license file. Is there any reason for that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.