Go: Difference between revisions

DHCP (talk | contribs)
m use monospace formatting where applicable, add more links, update link to the Go homepage
DHCP (talk | contribs)
m fix indentation
 
Line 63: Line 63:
==== Example (local source) ====
==== Example (local source) ====
If you want to build a local project with Nix, replace the <code>src</code> attribute to be the local directory, e.g.:<syntaxhighlight lang="nix">
If you want to build a local project with Nix, replace the <code>src</code> attribute to be the local directory, e.g.:<syntaxhighlight lang="nix">
  some-package = buildGoModule {
some-package = buildGoModule {
    src = ./.
  src = ./.
  };
};
</syntaxhighlight>
</syntaxhighlight>


Line 72: Line 72:
to change the source root, use
to change the source root, use
<syntaxhighlight lang=nix>
<syntaxhighlight lang=nix>
  some-package = buildGoModule {
some-package = buildGoModule {
    src = fetchFromGitHub {
  src = fetchFromGitHub {
      # ...
    } + "/path/to/module";
     # ...
     # ...
   };
   } + "/path/to/module";
  # ...
};
</syntaxhighlight>
</syntaxhighlight>


Line 85: Line 85:
which is linked with
which is linked with
<syntaxhighlight lang=nix>
<syntaxhighlight lang=nix>
  some-package = buildGoPackage {
some-package = buildGoPackage {
    # ...
  # ...
    goDeps = ./deps.nix;
  goDeps = ./deps.nix;
  };
};
</syntaxhighlight>
</syntaxhighlight>