diff --git a/app/dispatcher/default.go b/app/dispatcher/default.go index 5ffea14f..68e25f7a 100644 --- a/app/dispatcher/default.go +++ b/app/dispatcher/default.go @@ -29,7 +29,7 @@ type cachedReader struct { func (r *cachedReader) Cache(b *buf.Buffer) { mb, _ := r.reader.ReadMultiBufferWithTimeout(time.Millisecond * 100) if !mb.IsEmpty() { - r.cache.WriteMultiBuffer(mb) + common.Must(r.cache.WriteMultiBuffer(mb)) } common.Must(b.Reset(func(x []byte) (int, error) { return r.cache.Copy(x), nil diff --git a/app/dns/dns.go b/app/dns/dns.go index 77633f5f..ae2421ef 100644 --- a/app/dns/dns.go +++ b/app/dns/dns.go @@ -1,3 +1,4 @@ +// Package dns is an implementation of core.DNS feature. package dns //go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg dns -path App,DNS diff --git a/app/policy/config.go b/app/policy/config.go index cf65be9a..c5ecb065 100644 --- a/app/policy/config.go +++ b/app/policy/config.go @@ -68,6 +68,7 @@ func (p *Policy) ToCorePolicy() core.Policy { return cp } +// ToCorePolicy converts this SystemPolicy to core.SystemPolicy. func (p *SystemPolicy) ToCorePolicy() core.SystemPolicy { return core.SystemPolicy{ Stats: core.SystemStatsPolicy{ diff --git a/app/policy/manager.go b/app/policy/manager.go index ebfde0e7..fd04ada0 100644 --- a/app/policy/manager.go +++ b/app/policy/manager.go @@ -45,6 +45,7 @@ func (m *Instance) ForLevel(level uint32) core.Policy { return core.DefaultPolicy() } +// ForSystem implements core.PolicyManager. func (m *Instance) ForSystem() core.SystemPolicy { if m.system == nil { return core.SystemPolicy{} diff --git a/app/policy/policy.go b/app/policy/policy.go index 32554afe..492e4596 100644 --- a/app/policy/policy.go +++ b/app/policy/policy.go @@ -1,3 +1,4 @@ +// Package policy is an implementation of core.PolicyManager feature. package policy //go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg policy -path App,Policy