initial import
This commit is contained in:
commit
c42569e7b0
7 changed files with 55 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
bin*
|
13
examples/demo/etc/etc.go
Normal file
13
examples/demo/etc/etc.go
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
package etc
|
||||||
|
|
||||||
|
import "git.sr.ht/~cco/go-scopes"
|
||||||
|
|
||||||
|
func Config() *scopes.Config {
|
||||||
|
return &scopes.Config{
|
||||||
|
Name: "dummy",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
NAME = "name"
|
||||||
|
)
|
7
examples/demo/etc/settings.go
Normal file
7
examples/demo/etc/settings.go
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
package etc
|
||||||
|
|
||||||
|
func Override() map[string]string {
|
||||||
|
return map[string]string{
|
||||||
|
NAME: "overridden",
|
||||||
|
}
|
||||||
|
}
|
7
examples/demo/go.mod
Normal file
7
examples/demo/go.mod
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
module demo
|
||||||
|
|
||||||
|
go 1.20
|
||||||
|
|
||||||
|
require git.sr.ht/~cco/go-scopes v0.1.20
|
||||||
|
|
||||||
|
replace git.sr.ht/~cco/go-scopes => ../../../go-scopes
|
16
examples/demo/main.go
Normal file
16
examples/demo/main.go
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"demo/etc"
|
||||||
|
|
||||||
|
"git.sr.ht/~cco/go-scopes"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fmt.Println("vim-go")
|
||||||
|
scopes.Setup()
|
||||||
|
fmt.Println(etc.Config().Name)
|
||||||
|
fmt.Println(etc.Override()["name"])
|
||||||
|
}
|
3
go.mod
Normal file
3
go.mod
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
module git.sr.ht/~cco/go-scopes
|
||||||
|
|
||||||
|
go 1.20
|
8
scopes.go
Normal file
8
scopes.go
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
package scopes
|
||||||
|
|
||||||
|
type Config struct {
|
||||||
|
Name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func Setup() {
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue