3 # Copyright 2020 The Go Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style
5 # license that can be found in the LICENSE file.
14 // Copyright 2020 The Go Authors. All rights reserved.
15 // Use of this source code is governed by a BSD-style
16 // license that can be found in the LICENSE file.
18 //go:generate ./gen-licenses.sh licenses.go
21 const licensesText = \`
24 # List all the modules gopls depends on, except other golang.org modules, which
25 # are known to have the same license.
26 mods=$(go list -deps -f '{{with .Module}}{{.Path}}{{end}}' golang.org/x/tools/gopls | sort -u | grep -v golang.org)
28 # Find the license file, either LICENSE or COPYING, and add it to the result.
29 dir=$(go list -m -f {{.Dir}} $mod)
30 license=$(ls -1 $dir | egrep -i '^(LICENSE|COPYING)$')
31 echo "-- $mod $license --" >> $tempfile
33 sed 's/^-- / &/' $dir/$license >> $tempfile
37 echo "\`" >> $tempfile