├── .github └── workflows │ └── go.yml ├── .gitignore ├── LICENSE ├── README.md ├── cmd ├── license.go └── root.go ├── go.mod ├── go.sum └── main.go /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | name: LICENSE-GENERATOR 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*.*.*' 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | timeout-minutes: 30 12 | 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v2 16 | 17 | - name: Set up Go 18 | uses: actions/setup-go@v4 19 | with: 20 | go-version: '1.22.3' 21 | 22 | - name: Build the binary 23 | run: | 24 | GOOS=linux go build -o license-generator-linux 25 | 26 | - name: Create GitHub Release 27 | id: create_release 28 | uses: actions/create-release@v1 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} 31 | with: 32 | tag_name: ${{ github.ref }} 33 | release_name: 'License Generator Release ${{ github.ref }}' 34 | body: Initial release of license-generator for Linux. 35 | draft: false 36 | prerelease: false 37 | 38 | - name: Upload Release Asset 39 | uses: actions/upload-release-asset@v1 40 | with: 41 | upload_url: ${{ steps.create_release.outputs.upload_url }} 42 | asset_path: ./license-generator-linux 43 | asset_name: license-generator-linux 44 | asset_content_type: application/octet-stream 45 | env: 46 | GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Output of the build process 9 | /bin/ 10 | /build/ 11 | 12 | # Output of the coverage tool 13 | *.out 14 | 15 | # Directories for Go modules 16 | /vendor/ 17 | 18 | # Logs and databases 19 | *.log 20 | *.sqlite3 21 | 22 | # Dependency directories (remove the comment below if you're using Go modules) 23 | /vendor/ 24 | 25 | # IDE/editor specific files 26 | .vscode/ 27 | .idea/ 28 | *.swp 29 | 30 | # OS generated files 31 | .DS_Store 32 | Thumbs.db 33 | 34 | # Coverage reports 35 | coverage.out 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Abhijit Roy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

License Generator

2 | 3 | 4 |

5 | License Generator Demo 6 |

7 | 8 | ### Overview 9 | 10 | With the License Generator 🚀, you can streamline your workflow effortlessly. Instead of navigating through GitHub’s interface 🖥️, you simply run a command in your terminal to generate and add the license of your choice directly into your project 🛠️. 11 | 12 | This tool eliminates the need for tedious manual steps, allowing you to focus more on writing code and less on administrative tasks 🧑‍💻. Whether you're setting up a new repository or updating an existing one, the License Generator makes the process quick and hassle-free 🎉. 13 | 14 | ### Installation 15 | 16 | Download the latest binary from the [releases page](https://github.com/abhijitxy/license-generator/releases). 17 | 18 | ```bash 19 | # For Linux 20 | wget https://github.com/abhijitxy/license-generator/releases/download/v1.0.0/license-generator-linux 21 | chmod +x license-generator-linux 22 | mv license-generator-linux /usr/local/bin/license-gen 23 | ``` 24 | 25 | ### Usage 26 | 27 | ```bash 28 | license-gen 29 | ``` 30 | 31 | ### Contributing 32 | 33 | - Fork the repository 34 | - Create a branch 35 | - Install dependencies 36 | ```bash 37 | go mod tidy 38 | ``` 39 | - Build 40 | ```bash 41 | go build -o license-generator 42 | ``` 43 | - Commit your changes and push to your branch 44 | ```bash 45 | git commit -m "made an awesomeFix" 46 | git push origin fix/awesomeFix 47 | ``` 48 | - Open a pull request 49 | -------------------------------------------------------------------------------- /cmd/license.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | func generateLicense(template, year, name string) error { 9 | var licenseText string 10 | 11 | switch template { 12 | case "MIT": 13 | licenseText = fmt.Sprintf(mitTemplate, year, name) 14 | case "Apache": 15 | licenseText = fmt.Sprintf(apacheTemplate, year, name) 16 | case "AGPL": 17 | licenseText = fmt.Sprintf(agplTemplate, year, name) 18 | case "BSD-2-Clause": 19 | licenseText = fmt.Sprintf(bsd2ClauseTemplate, year, name) 20 | case "BSD-3-Clause": 21 | licenseText = fmt.Sprintf(bsd3ClauseTemplate, year, name) 22 | case "Boost": 23 | licenseText = fmt.Sprintf(boostTemplate, year, name) 24 | case "CC0": 25 | licenseText = cc0Template 26 | case "EPL": 27 | licenseText = eplTemplate 28 | case "GPL-2.0": 29 | licenseText = fmt.Sprintf(gpl2Template, year, name) 30 | case "GPL-3.0": 31 | licenseText = fmt.Sprintf(gpl3Template, year, name) 32 | case "LGPL-2.1": 33 | licenseText = fmt.Sprintf(lgpl21Template, year, name) 34 | case "MPL": 35 | licenseText = mplTemplate 36 | case "Unlicense": 37 | licenseText = unlicenseTemplate 38 | default: 39 | return fmt.Errorf("unknown template: %s", template) 40 | } 41 | 42 | file, err := os.Create("LICENSE") 43 | if err != nil { 44 | return fmt.Errorf("creating file: %w", err) 45 | } 46 | defer file.Close() 47 | 48 | if _, err := file.WriteString(licenseText); err != nil { 49 | return fmt.Errorf("writing to file: %w", err) 50 | } 51 | 52 | fmt.Println("License file generated successfully") 53 | return nil 54 | } 55 | 56 | const mitTemplate = `MIT License 57 | 58 | Copyright (c) %s %s 59 | 60 | Permission is hereby granted, free of charge, to any person obtaining a copy 61 | of this software and associated documentation files (the "Software"), to deal 62 | in the Software without restriction, including without limitation the rights 63 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 64 | copies of the Software, and to permit persons to whom the Software is 65 | furnished to do so, subject to the following conditions: 66 | 67 | The above copyright notice and this permission notice shall be included in all 68 | copies or substantial portions of the Software. 69 | 70 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 71 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 72 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 73 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 74 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 75 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 76 | SOFTWARE.` 77 | 78 | const apacheTemplate = `Apache License 2.0 79 | 80 | Copyright (c) %s %s 81 | 82 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 83 | this file except in compliance with the License. You may obtain a copy of the 84 | License at 85 | 86 | http://www.apache.org/licenses/LICENSE-2.0 87 | 88 | Unless required by applicable law or agreed to in writing, software distributed 89 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 90 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 91 | specific language governing permissions and limitations under the License.` 92 | 93 | const agplTemplate = `GNU AFFERO GENERAL PUBLIC LICENSE 94 | Version 3, 19 November 2007 95 | 96 | Copyright (C) %s %s 97 | 98 | Everyone is permitted to copy and distribute verbatim copies 99 | of this license document, but changing it is not allowed. 100 | 101 | [...] 102 | 103 | You should have received a copy of the GNU Affero General Public License 104 | along with this program. If not, see .` 105 | 106 | const bsd2ClauseTemplate = `BSD 2-Clause License 107 | 108 | Copyright (c) %s %s 109 | All rights reserved. 110 | 111 | Redistribution and use in source and binary forms, with or without 112 | modification, are permitted provided that the following conditions are met: 113 | 114 | 1. Redistributions of source code must retain the above copyright notice, this 115 | list of conditions and the following disclaimer. 116 | 2. Redistributions in binary form must reproduce the above copyright notice, 117 | this list of conditions and the following disclaimer in the documentation 118 | and/or other materials provided with the distribution. 119 | 120 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 121 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 122 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 123 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 124 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 125 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 126 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 127 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 128 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 129 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.` 130 | 131 | const bsd3ClauseTemplate = `BSD 3-Clause License 132 | 133 | Copyright (c) %s %s 134 | All rights reserved. 135 | 136 | Redistribution and use in source and binary forms, with or without 137 | modification, are permitted provided that the following conditions are met: 138 | 139 | 1. Redistributions of source code must retain the above copyright notice, this 140 | list of conditions and the following disclaimer. 141 | 2. Redistributions in binary form must reproduce the above copyright notice, 142 | this list of conditions and the following disclaimer in the documentation 143 | and/or other materials provided with the distribution. 144 | 3. Neither the name of the copyright holder nor the names of its 145 | contributors may be used to endorse or promote products derived from 146 | this software without specific prior written permission. 147 | 148 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 149 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 150 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 151 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 152 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 153 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 154 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 155 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 156 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 157 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.` 158 | 159 | const boostTemplate = `Boost Software License - Version 1.0 - August 17th, 2003 160 | 161 | Copyright (C) %s %s 162 | All rights reserved. 163 | 164 | Permission is hereby granted, free of charge, to any person or organization 165 | obtaining a copy of the software and accompanying documentation covered by 166 | this license (the "Software") to use, reproduce, display, distribute, 167 | execute, and transmit the Software, and to prepare derivative works of the 168 | Software, and to permit third-parties to whom the Software is furnished to 169 | do so, all subject to the following: 170 | 171 | The copyright notices in the Software and this entire statement, including 172 | the above license grant, this restriction and the following disclaimer, 173 | must be included in all copies of the Software, in whole or in part, and 174 | all derivative works of the Software, unless such copies or derivative 175 | works are solely in the form of machine-executable object code generated by 176 | a source language processor. 177 | 178 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 179 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 180 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 181 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 182 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 183 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 184 | DEALINGS IN THE SOFTWARE.` 185 | 186 | const cc0Template = `Creative Commons Legal Code 187 | 188 | CC0 1.0 Universal 189 | 190 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 191 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 192 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 193 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 194 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 195 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 196 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 197 | HEREUNDER. 198 | 199 | Statement of Purpose 200 | 201 | The laws of most jurisdictions throughout the world automatically confer 202 | exclusive Copyright and Related Rights (defined below) upon the creator 203 | and subsequent owner(s) (each and all, an "owner") of an original work of 204 | authorship and/or a database (each, a "Work"). 205 | 206 | Certain owners wish to permanently relinquish those rights to a Work for the 207 | purpose of contributing to a commons of creative, cultural and scientific 208 | works ("Commons") that the public can reliably and without fear of later 209 | claims of infringement build upon, modify, incorporate in other works, reuse 210 | and redistribute as freely as possible in any form whatsoever and for any 211 | purposes, including without limitation commercial purposes. These owners may 212 | contribute to the Commons to promote the ideal of a free culture and the 213 | further production of creative, cultural and scientific works, or to gain 214 | reputation or greater distribution for their Work in part through the use and 215 | efforts of others. 216 | 217 | For these and/or other purposes and motivations, and without any expectation 218 | of additional consideration or compensation, the person associating CC0 with a 219 | Work (the "Affirmer"), to the extent that he or she is an owner of Copyright 220 | and Related Rights in the Work, voluntarily elects to apply CC0 to the Work 221 | and publicly distribute the Work under its terms, with knowledge of his or her 222 | Copyright and Related Rights in the Work and the meaning and intended legal 223 | effect of CC0 on those rights. 224 | 225 | 1. Copyright and Related Rights. A Work made available under CC0 may be 226 | protected by copyright and related or neighboring rights ("Copyright and 227 | Related Rights"). Copyright and Related Rights include, but are not limited 228 | to, the following: 229 | 230 | i. the right to reproduce, adapt, distribute, perform, display, communicate, 231 | and translate a Work; 232 | 233 | ii. moral rights retained by the original author(s) and/or performer(s); 234 | 235 | iii. publicity and privacy rights pertaining to a person's image or likeness 236 | depicted in a Work; 237 | 238 | iv. rights protecting against unfair competition in regards to a Work, 239 | subject to the limitations in paragraph 4(a), below; 240 | 241 | v. rights protecting the extraction, dissemination, use and reuse of data in 242 | a Work; 243 | 244 | vi. database rights (such as those arising under Directive 96/9/EC of the 245 | European Parliament and of the Council of 11 March 1996 on the legal 246 | protection of databases, and under any national implementation thereof, 247 | including any amended or successor version of such directive); and 248 | 249 | vii. other similar, equivalent or corresponding rights throughout the world 250 | based on applicable law or treaty, and any national implementations thereof. 251 | 252 | 2. Waiver. To the greatest extent permitted by, but not in contravention of, 253 | applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and 254 | unconditionally waives, abandons, and surrenders all of Affirmer's Copyright 255 | and Related Rights and associated claims and causes of action, whether now 256 | known or unknown (including existing as well as future claims and causes of 257 | action), in the Work (i) in all territories worldwide, (ii) for the maximum 258 | duration provided by applicable law or treaty (including future time 259 | extensions), (iii) in any current or future medium and for any number of 260 | copies, and (iv) for any purpose whatsoever, including without limitation 261 | commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes 262 | the Waiver for the benefit of each member of the public at large and to the 263 | detriment of Affirmer's heirs and successors, fully intending that such Waiver 264 | shall not be subject to revocation, rescission, cancellation, termination, or 265 | any other legal or equitable action to disrupt the quiet enjoyment of the Work 266 | by the public as contemplated by Affirmer's express Statement of Purpose. 267 | 268 | 3. Public License Fallback. Should any part of the Waiver for any reason be 269 | judicially deemed invalid or ineffective under applicable law, then the 270 | Affirmer hereby grants to each affected person a royalty-free, non 271 | transferable, non sublicensable, non exclusive, irrevocable and unconditional 272 | license to exercise Affirmer's Copyright and Related Rights in the Work (i) in 273 | all territories worldwide, (ii) for the maximum duration provided by applicable 274 | law or treaty (including future time extensions), (iii) in any current or 275 | future medium and for any number of copies, and (iv) for any purpose whatsoever, 276 | including without limitation commercial, advertising or promotional purposes. 277 | The license shall be deemed effective as of the date CC0 was applied to the 278 | Work. Should any part of the Waiver be judicially deemed invalid or 279 | ineffective, such Public License Fallback shall not affect the remainder of the 280 | Waiver. 281 | 282 | 4. Limitations and Disclaimers. 283 | 284 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 285 | surrendered, licensed or otherwise affected by this document. 286 | 287 | b. Affirmer offers the Work as-is and makes no representations or warranties 288 | of any kind concerning the Work, express, implied, statutory or otherwise, 289 | including without limitation warranties of title, merchantability, fitness for 290 | a particular purpose, non infringement, or the absence of latent or other 291 | defects, accuracy, or the present or absence of errors, whether or not 292 | discoverable, all to the greatest extent permissible under applicable law. 293 | 294 | c. Affirmer disclaims responsibility for clearing rights of other persons 295 | that may apply to the Work or any use thereof, including without limitation 296 | any person's Copyright and Related Rights in the Work. Further, Affirmer 297 | disclaims responsibility for obtaining any necessary consents, permissions or 298 | other rights required for any use of the Work. 299 | 300 | d. Affirmer understands and acknowledges that Creative Commons is not a 301 | party to this document and has no duty or obligation with respect to this 302 | CC0 or use of the Work.` 303 | 304 | const eplTemplate = `Eclipse Public License - v 2.0 305 | 306 | Copyright (c) %s %s 307 | 308 | This program and the accompanying materials are made available under the 309 | terms of the Eclipse Public License v. 2.0 which is available at 310 | http://www.eclipse.org/legal/epl-2.0. 311 | 312 | SPDX-License-Identifier: EPL-2.0 313 | 314 | THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR 315 | CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT 316 | LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, 317 | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 318 | 319 | See the Eclipse Public License for more details.` 320 | 321 | const gpl2Template = `GNU GENERAL PUBLIC LICENSE 322 | Version 2, June 1991 323 | 324 | Copyright (C) %s %s 325 | 326 | Everyone is permitted to copy and distribute verbatim copies 327 | of this license document, but changing it is not allowed. 328 | 329 | [...] 330 | 331 | You should have received a copy of the GNU General Public License 332 | along with this program. If not, see .` 333 | 334 | const gpl3Template = `GNU GENERAL PUBLIC LICENSE 335 | Version 3, 29 June 2007 336 | 337 | Copyright (C) %s %s 338 | 339 | Everyone is permitted to copy and distribute verbatim copies 340 | of this license document, but changing it is not allowed. 341 | 342 | [...] 343 | 344 | You should have received a copy of the GNU General Public License 345 | along with this program. If not, see .` 346 | 347 | const lgpl21Template = `GNU LESSER GENERAL PUBLIC LICENSE 348 | Version 2.1, February 1999 349 | 350 | Copyright (C) %s %s 351 | 352 | Everyone is permitted to copy and distribute verbatim copies 353 | of this license document, but changing it is not allowed. 354 | 355 | [...] 356 | 357 | You should have received a copy of the GNU Lesser General Public License 358 | along with this program. If not, see .` 359 | 360 | const mplTemplate = `Mozilla Public License Version 2.0 361 | 362 | 1. Definitions 363 | 364 | 1.1. “Contributor” 365 | means each individual or legal entity that creates, contributes to 366 | the creation of, or owns Covered Software. 367 | 368 | 1.2. “Contributor Version” 369 | means the combination of the Contributions of others (if any) used 370 | by a Contributor and that particular Contributor’s Contribution. 371 | 372 | 1.3. “Contribution” 373 | means Covered Software of a particular Contributor. 374 | 375 | 1.4. “Covered Software” 376 | means Source Code Form to which the initial Contributor has attached 377 | the notice in Exhibit A, the Executable Form of such Source Code 378 | Form, and Modifications of such Source Code Form, in each case 379 | including portions thereof. 380 | 381 | 1.5. “Incompatible With Secondary Licenses” 382 | means 383 | 384 | (a) that the initial Contributor has attached the notice described 385 | in Exhibit B to the Covered Software; or 386 | 387 | (b) that the Covered Software was made available under the terms of 388 | version 1.1 or earlier of the License, but not also under the terms 389 | of a Secondary License. 390 | 391 | 1.6. “Executable Form” 392 | means any form of the work other than Source Code Form. 393 | 394 | 1.7. “Larger Work” 395 | means a work that combines Covered Software with other material, in 396 | a separate file or files, that is not Covered Software. 397 | 398 | 1.8. “License” 399 | means this document. 400 | 401 | 1.9. “Licensable” 402 | means having the right to grant, to the maximum extent possible, 403 | whether at the time of the initial grant or subsequently, any and 404 | all of the rights conveyed by this License. 405 | 406 | 1.10. “Modifications” 407 | means any of the following: 408 | 409 | (a) any file in Source Code Form that results from an addition to, 410 | deletion from, or modification of the contents of Covered Software; 411 | or 412 | 413 | (b) any new file in Source Code Form that contains any Covered 414 | Software. 415 | 416 | 1.11. “Patent Claims” of a Contributor 417 | means any patent claim(s), including without limitation, method, 418 | process, and apparatus claims, in any patent Licensable by such 419 | Contributor that would be infringed, but for the grant of the 420 | License, by the making, using, selling, offering for sale, having 421 | made, importation, or transfer of either its Contributions or its 422 | Contributor Version. 423 | 424 | 1.12. “Secondary License” 425 | means either the GNU General Public License, Version 2.0, the GNU 426 | Lesser General Public License, Version 2.1, the GNU Affero General 427 | Public License, Version 3.0, or any later versions of those 428 | licenses. 429 | 430 | 1.13. “Source Code Form” 431 | means the form of the work preferred for making modifications. 432 | 433 | 1.14. “You” (or “Your”) 434 | means an individual or a legal entity exercising rights under this 435 | License. For legal entities, “You” includes any entity that controls, 436 | is controlled by, or is under common control with You. For purposes 437 | of this definition, “control” means (a) the power, direct or 438 | indirect, to cause the direction or management of such entity, 439 | whether by contract or otherwise, or (b) ownership of more than 440 | fifty percent (50%) of the outstanding shares or beneficial 441 | ownership of such entity. 442 | 443 | 2. License Grants and Conditions 444 | 445 | 2.1. Grants 446 | 447 | Each Contributor hereby grants You a world-wide, royalty-free, 448 | non-exclusive license: 449 | 450 | (a) under intellectual property rights (other than patent or trademark) 451 | Licensable by such Contributor to use, reproduce, make available, 452 | modify, display, perform, distribute, and otherwise exploit its 453 | Contributions, either on an unmodified basis, with Modifications, or as 454 | part of a Larger Work; and 455 | 456 | (b) under Patent Claims of such Contributor to make, use, sell, offer 457 | for sale, have made, import, and otherwise transfer either its 458 | Contributions or its Contributor Version. 459 | 460 | 2.2. Effective Date 461 | 462 | The licenses granted in Section 2.1 with respect to any Contribution 463 | become effective for each Contribution on the date the Contributor first 464 | distributes such Contribution. 465 | 466 | 2.3. Limitations on Grant Scope 467 | 468 | The licenses granted in this Section 2 are the only rights granted under 469 | this License. No additional rights or licenses will be implied from the 470 | distribution or licensing of Covered Software under this License. 471 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 472 | Contributor: 473 | 474 | (a) for any code that a Contributor has removed from Covered Software; 475 | or 476 | 477 | (b) for infringements caused by: (i) Your and any other third party’s 478 | modifications of Covered Software, or (ii) the combination of its 479 | Contributions with other software (except as part of its Contributor 480 | Version); or 481 | 482 | (c) under Patent Claims infringed by Covered Software in the absence of 483 | its Contributions. 484 | 485 | This License does not grant any rights in the trademarks, service marks, 486 | or logos of any Contributor (except as may be necessary to comply with 487 | the notice requirements in Section 3.4). 488 | 489 | 2.4. Subsequent Licenses 490 | 491 | No Contributor makes additional grants as a result of Your choice to 492 | distribute the Covered Software under a subsequent version of this 493 | License (see Section 10.2) or under the terms of a Secondary License (if 494 | permitted under the terms of Section 3.3). 495 | 496 | 2.5. Representation 497 | 498 | Each Contributor represents that the Contributor believes its 499 | Contributions are its original creation(s) or it has sufficient rights 500 | to grant the rights to its Contributions conveyed by this License. 501 | 502 | 2.6. Fair Use 503 | 504 | This License is not intended to limit any rights You have under 505 | applicable copyright doctrines of fair use, fair dealing, or other 506 | equivalents. 507 | 508 | 2.7. Conditions 509 | 510 | Sections 3.1, 3.2, 3.3, and 3.4 set forth conditions for exercising the 511 | rights granted to You in Section 2.1. 512 | 513 | 3. Responsibilities 514 | 515 | 3.1. Distribution of Source Form 516 | 517 | All distribution of Covered Software in Source Code Form, including any 518 | Modifications that You create or to which You contribute, must be under 519 | the terms of this License. You must inform recipients that the Source 520 | Code Form of the Covered Software is governed by the terms of this 521 | License, and how they can obtain a copy of this License. You may not 522 | attempt to alter or restrict the recipients’ rights in the Source Code 523 | Form. 524 | 525 | 3.2. Distribution of Executable Form 526 | 527 | If You distribute Covered Software in Executable Form then: 528 | 529 | (a) such Covered Software must also be made available in Source Code 530 | Form, as described in Section 3.1, and You must inform recipients of the 531 | Executable Form how they can obtain a copy of such Source Code Form by 532 | reasonable means in a timely manner, at a charge no more than the cost 533 | of distribution to the recipient; and 534 | 535 | (b) You may distribute such Executable Form under the terms of this 536 | License, or sublicense it under different terms, provided that the 537 | license for the Executable Form does not attempt to limit or alter the 538 | recipients’ rights in the Source Code Form under this License. 539 | 540 | 3.3. Distribution of a Larger Work 541 | 542 | You may create and distribute a Larger Work under terms of Your choice, 543 | provided that You also comply with the requirements of this License for 544 | the Covered Software. If the Larger Work is a combination of Covered 545 | Software with a work governed by one or more Secondary Licenses, and the 546 | Covered Software is not Incompatible With Secondary Licenses, this 547 | License permits You to additionally distribute such Covered Software 548 | under the terms of such Secondary License(s), so that the recipient of 549 | the Larger Work may, at their option, further distribute the Covered 550 | Software under the terms of either this License or such Secondary 551 | License(s). 552 | 553 | 3.4. Notices 554 | 555 | You may not remove or alter the substance of any license notices 556 | (including copyright notices, patent notices, disclaimers of warranty, 557 | or limitations of liability) contained within the Source Code Form of 558 | the Covered Software, except that You may alter any license notices to 559 | the extent required to remedy known factual inaccuracies. 560 | 561 | 3.5. Application of Additional Terms 562 | 563 | You may choose to offer, and to charge a fee for, warranty, support, 564 | indemnity or liability obligations to one or more recipients of Covered 565 | Software. However, You may do so only on Your own behalf, and not on 566 | behalf of any Contributor. You must make it absolutely clear that any 567 | such warranty, support, indemnity, or liability obligation is offered by 568 | You alone, and You hereby agree to indemnify every Contributor for any 569 | liability incurred by such Contributor as a result of warranty, support, 570 | indemnity or liability terms You offer. You may include additional 571 | disclaimers of warranty and limitations of liability specific to any 572 | jurisdiction. 573 | 574 | 4. Inability to Comply Due to Statute or Regulation 575 | 576 | If it is impossible for You to comply with any of the terms of this 577 | License with respect to some or all of the Covered Software due to 578 | statute, judicial order, or regulation then You must: (a) comply with 579 | the terms of this License to the maximum extent possible; and (b) 580 | describe the limitations and the code they affect. Such description must 581 | be placed in a text file included with all distributions of the Covered 582 | Software under this License. Except to the extent prohibited by statute 583 | or regulation, such description must be sufficiently detailed for a 584 | recipient of ordinary skill to be able to understand it. 585 | 586 | 5. Termination 587 | 588 | 5.1. The rights granted under this License will terminate automatically 589 | if You fail to comply with any of its terms. However, if You become 590 | compliant, then the rights granted under this License from a particular 591 | Contributor are reinstated (a) provisionally, unless and until such 592 | Contributor explicitly and finally terminates Your grants, and (b) on an 593 | ongoing basis, if such Contributor fails to notify You of the 594 | non-compliance by some reasonable means prior to 60 days after You have 595 | come back into compliance. Moreover, Your grants from a particular 596 | Contributor are reinstated on an ongoing basis if such Contributor 597 | notifies You of the non-compliance by some reasonable means, this is the 598 | first time You have received notice of non-compliance with this License 599 | from such Contributor, and You become compliant prior to 30 days after 600 | Your receipt of the notice. 601 | 602 | 5.2. If You initiate litigation against any entity by asserting a patent 603 | infringement claim (excluding declaratory judgment actions, 604 | counter-claims, and cross-claims) alleging that a Contributor Version 605 | directly or indirectly infringes any patent, then the rights granted to 606 | You by any and all Contributors for the Covered Software under Section 607 | 2.1 of this License shall terminate. 608 | 609 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 610 | end user license agreements (excluding distributors and resellers) which 611 | have been validly granted by You or Your distributors under this License 612 | prior to termination shall survive termination. 613 | 614 | ************************************************************************ 615 | * * 616 | * 6. Disclaimer of Warranty * 617 | * 7. Limitation of Liability * 618 | * * 619 | * 8. Litigation * 620 | * * 621 | * 9. Miscellaneous * 622 | * * 623 | * 10. Versions of the License * 624 | * * 625 | ************************************************************************ 626 | 6. Disclaimer of Warranty 627 | 628 | Covered Software is provided under this License on an “as is” basis, 629 | without warranty of any kind, either expressed, implied, or statutory, 630 | including, without limitation, warranties that the Covered Software is 631 | free of defects, merchantable, fit for a particular purpose or 632 | non-infringing. The entire risk as to the quality and performance of the 633 | Covered Software is with You. Should any Covered Software prove 634 | defective in any respect, You (not any Contributor) assume the cost of 635 | any necessary servicing, repair, or correction. This disclaimer of 636 | warranty constitutes an essential part of this License. No use of any 637 | Covered Software is authorized under this License except under this 638 | disclaimer. 639 | 640 | 7. Limitation of Liability 641 | 642 | Under no circumstances and under no legal theory, whether tort 643 | (including negligence), contract, or otherwise, shall any Contributor, 644 | or anyone who distributes Covered Software as permitted above, be 645 | liable to You for any direct, indirect, special, incidental, or 646 | consequential damages of any character including, without limitation, 647 | damages for lost profits, loss of goodwill, work stoppage, computer 648 | failure or malfunction, or any and all other commercial damages or 649 | losses, even if such party shall have been informed of the possibility 650 | of such damages. This limitation of liability shall not apply to 651 | liability for death or personal injury resulting from such party’s 652 | negligence to the extent applicable law prohibits such limitation. Some 653 | jurisdictions do not allow the exclusion or limitation of incidental or 654 | consequential damages, so this exclusion and limitation may not apply to 655 | You. 656 | 657 | 8. Litigation 658 | 659 | Any litigation relating to this License may be brought only in the 660 | courts of a jurisdiction where the defendant maintains its principal 661 | place of business and such litigation shall be governed by laws of that 662 | jurisdiction, without reference to its conflict-of-law provisions. 663 | Nothing in this Section shall prevent a party’s ability to bring 664 | cross-claims or counter-claims. 665 | 666 | 9. Miscellaneous 667 | 668 | This License represents the complete agreement concerning the subject 669 | matter hereof. If any provision of this License is held to be 670 | unenforceable, such provision shall be reformed only to the extent 671 | necessary to make it enforceable. Any law or regulation which provides 672 | that the language of a contract shall be construed against the drafter 673 | shall not be used to construe this License against a Contributor. 674 | 675 | 10. Versions of the License 676 | 677 | 10.1. New Versions 678 | 679 | Mozilla Foundation is the license steward. Except as provided in Section 680 | 10.3, no one other than the license steward has the right to modify or 681 | publish new versions of this License. Each version will be given a 682 | distinguishing version number. 683 | 684 | 10.2. Effect of New Versions 685 | 686 | You may distribute the Covered Software under the terms of the version 687 | of the License under which You originally received the Covered Software, 688 | or under the terms of any subsequent version published by the license 689 | steward. 690 | 691 | 10.3. Modified Versions 692 | 693 | If you create software not governed by this License, and you want to 694 | create a new license for such software, you may create and use a 695 | modified version of this License if you rename the license and remove 696 | any references to the name of the license steward (except to note that 697 | such modified license differs from this License). 698 | 699 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 700 | Licenses 701 | 702 | If You choose to distribute Source Code Form that is Incompatible With 703 | Secondary Licenses under the terms of this version of the License, the 704 | notice described in Exhibit B of this License must be attached. 705 | 706 | Exhibit A - Source Code Form License Notice 707 | 708 | This Source Code Form is subject to the terms of the Mozilla Public 709 | License, v. 2.0. If a copy of the MPL was not distributed with this file, 710 | You can obtain one at http://mozilla.org/MPL/2.0/. 711 | 712 | If it is not possible or desirable to put the notice in a particular file, 713 | then You may include the notice in a location (such as a LICENSE file in a 714 | relevant directory) where a recipient would be likely to look for such a 715 | notice. 716 | 717 | You may add additional accurate notices of copyright ownership. 718 | 719 | Exhibit B - “Incompatible With Secondary Licenses” Notice 720 | 721 | This Source Code Form is “Incompatible With Secondary Licenses”, as 722 | defined by the Mozilla Public License, v. 2.0.` 723 | 724 | const unlicenseTemplate = `This is free and unencumbered software released into the public domain. 725 | 726 | Anyone is free to copy, modify, publish, use, compile, sell, or 727 | distribute this software, either in source code form or as a compiled 728 | binary, for any purpose, commercial or non-commercial, and by any 729 | means. 730 | 731 | In jurisdictions that recognize copyright laws, the author or authors 732 | of this software dedicate any and all copyright interest in the 733 | software to the public domain. We make this dedication for the benefit 734 | of the public at large and to the detriment of our heirs and 735 | successors. We intend this dedication to be an overt act of 736 | relinquishment in perpetuity of all present and future rights to this 737 | software under copyright law. 738 | 739 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 740 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 741 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 742 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 743 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 744 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 745 | OTHER DEALINGS IN THE SOFTWARE. 746 | 747 | For more information, please refer to ` 748 | -------------------------------------------------------------------------------- /cmd/root.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/AlecAivazis/survey/v2" 7 | "github.com/spf13/cobra" 8 | ) 9 | 10 | var rootCmd = &cobra.Command{ 11 | Use: "license-gen", 12 | Short: "A CLI tool to generate licenses", 13 | Run: func(cmd *cobra.Command, args []string) { 14 | var year string 15 | var name string 16 | 17 | // Define available templates 18 | templates := []string{ 19 | "MIT", "Apache", "AGPL", "BSD-2-Clause", "BSD-3-Clause", "Boost", 20 | "CC0", "EPL", "GPL-2.0", "GPL-3.0", "LGPL-2.1", "MPL", "Unlicense", 21 | } 22 | 23 | // Prompt user to select a template 24 | var selectedTemplate string 25 | templatePrompt := &survey.Select{ 26 | Message: "Choose a template:", 27 | Options: templates, 28 | } 29 | err := survey.AskOne(templatePrompt, &selectedTemplate) 30 | if err != nil { 31 | fmt.Println("Error selecting template:", err) 32 | return 33 | } 34 | 35 | // Templates that require year and name 36 | templatesWithYearName := map[string]bool{ 37 | "MIT": true, 38 | "Apache": true, 39 | "AGPL": true, 40 | "BSD-2-Clause": true, 41 | "BSD-3-Clause": true, 42 | "Boost": true, 43 | "GPL-2.0": true, 44 | "GPL-3.0": true, 45 | "LGPL-2.1": true, 46 | } 47 | 48 | // Prompt user for the year if needed 49 | if templatesWithYearName[selectedTemplate] { 50 | yearPrompt := &survey.Input{ 51 | Message: "Enter the year:", 52 | Default: "2024", 53 | } 54 | err = survey.AskOne(yearPrompt, &year) 55 | if err != nil { 56 | fmt.Println("Error entering year:", err) 57 | return 58 | } 59 | 60 | // Prompt user for the name if needed 61 | namePrompt := &survey.Input{ 62 | Message: "Enter your name:", 63 | Default: "Your Name", 64 | } 65 | err = survey.AskOne(namePrompt, &name) 66 | if err != nil { 67 | fmt.Println("Error entering name:", err) 68 | return 69 | } 70 | } 71 | 72 | // Generate the license file with the selected template 73 | if err := generateLicense(selectedTemplate, year, name); err != nil { 74 | fmt.Println("Error:", err) 75 | } 76 | }, 77 | } 78 | 79 | func Execute() error { 80 | return rootCmd.Execute() 81 | } 82 | 83 | func init() { 84 | // No longer setting default values for year and name 85 | } 86 | 87 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module license-gen 2 | 3 | go 1.22.3 4 | 5 | require github.com/spf13/cobra v1.8.0 6 | 7 | require ( 8 | github.com/AlecAivazis/survey/v2 v2.3.7 // indirect 9 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 10 | github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect 11 | github.com/mattn/go-colorable v0.1.13 // indirect 12 | github.com/mattn/go-isatty v0.0.20 // indirect 13 | github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect 14 | github.com/spf13/pflag v1.0.5 // indirect 15 | golang.org/x/sys v0.20.0 // indirect 16 | golang.org/x/term v0.20.0 // indirect 17 | golang.org/x/text v0.15.0 // indirect 18 | ) 19 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ= 2 | github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo= 3 | github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w= 4 | github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 5 | github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= 6 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 7 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 8 | github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= 9 | github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= 10 | github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 11 | github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= 12 | github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= 13 | github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= 14 | github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= 15 | github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= 16 | github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 17 | github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= 18 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= 19 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 20 | github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= 21 | github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= 22 | github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= 23 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 24 | github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 25 | github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= 26 | github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= 27 | github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= 28 | github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 29 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 30 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 31 | github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= 32 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 33 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 34 | golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= 35 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 36 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 37 | golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 38 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 39 | golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 40 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 41 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 42 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 43 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 44 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 45 | golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 46 | golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 47 | golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 48 | golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= 49 | golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 50 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 51 | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 52 | golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= 53 | golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= 54 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 55 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 56 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 57 | golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= 58 | golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= 59 | golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= 60 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 61 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 62 | golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= 63 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 64 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 65 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 66 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 67 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "license-gen/cmd" 4 | 5 | func main() { 6 | cmd.Execute() 7 | } 8 | --------------------------------------------------------------------------------