<p>I'm currently working on something that is making quite a bit of use of looking through one of Go's standard library package's internals and basically copy/pasting to some extent. I don't intend to make any money off of it or even promote myself with it, but I figured it'd be useful to share it on github or something eventually when it works. What I don't know is how that interacts with licensing, as I'm not particularly well versed in copyright law. Go's license (included in my <code>/usr/local/go</code> directory) says this</p>
<blockquote>
<p>Copyright (c) 2009 The Go Authors. All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:</p>
<ul>
<li>Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.</li>
<li>Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.</li>
</ul>
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
</blockquote>
<p>How do I use their code (as in I'm literally looking at unexported functions and making them exported or part of my package to some extent) in my project so that I'm not violating this?</p>
<hr/>**评论:**<br/><br/>fckthememeculture: <pre><p>Just add that Go copyright header to the top of the file, then add the license to the top of the file or in a file that accompanies your project. then add your own copyright header and compatible license in the same manner. I'd use a simplified 2-clause bsd license, as the third clause is considered implied in copyright law. The permissions in the license grant you to whatever so long as your changes are licensed under a compatible license.</p>
<p>In fact some are banking on it- hoping to do with the Go ecosystem what so many did with the BSD source.</p></pre>Sythe2o0: <pre><p>IANAL, this isn't legal advice. What I would do is, if you're planning on a commercial deal ever, consulting someone who is a lawyer / can give you legal advice. </p>
<p>As long as you aren't doing that, what I would do is copy the license and include it in the repo I was using. Some people choose to apply their license to every file that needs it, as a header to the file. IMO that is excessive.</p></pre>my_dev_acct: <pre><p>Definitely not anything commercial. Just a small tool I built to help myself with something the other day that I couldn't find anywhere else.</p>
<p>So you think I copy that exact license? Do I put my information in there anywhere? It seems strange that the copyright would be to "The Go Authors" if it isn't entirely their work and I'm not a representative of the Go authors. To what extent does it matter how much of the original source I copy?</p></pre>Sythe2o0: <pre><p>If it's only one or two files, I'd put the license in those files only. There isn't a good answer to "how much is enough to justify the use of a license"</p></pre>tscs37: <pre><p>It's a BSD License + Patent Grant, it should be similar to this: <a href="https://tldrlegal.com/license/bsd-3-clause-license-(revised)" rel="nofollow">https://tldrlegal.com/license/bsd-3-clause-license-(revised)</a></p>
<p>TL;DR: Commercial Use, Modification, Distribution and placing warranties is allowed, however, you cannot use google's trademorks or hold them liable. You <em>must</em> include the copyright and license notice in all distributions of substantial parts of the source.</p></pre>