Skip to content

E0425: A list entry that is no context processor ​

web.ContextProcessors(…) takes functions of one shape: func(ctx context.Context, deps…) (S, error), S a struct whose exported fields are the variables, declared in a package of its own (the packages main imports can't see main). The message says what is off: another shape, no exported field, a function of package main, web.Personal outside web.Browser, web.Auth without a gate. Reported by the compiler, by vuka vet and at boot.

Wrong ​

go
// settings/context.go
func Context(ctx context.Context) Settings { … }
go
// settings/context.go
type Vars struct{ Site Settings }

func Context(ctx context.Context, s *Store) (Vars, error) {
	site, err := s.Load(ctx)
	return Vars{Site: site}, err
}

See context processors.

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.