mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 13:18:53 +00:00
cmd/viewer,all: consistently use "read-only" instead of "readonly"
Updates #cleanup Change-Id: I8e4e3497d3d0ec5b16a73aedda500fe5cfa37a67 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
414a01126a
commit
cfda1ff709
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
//go:generate go run tailscale.com/cmd/cloner -clonefunc=true -type=Resolver
|
||||
|
||||
// View returns a readonly view of Resolver.
|
||||
// View returns a read-only view of Resolver.
|
||||
func (p *Resolver) View() ResolverView {
|
||||
return ResolverView{ж: p}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ type ResolverView struct {
|
||||
ж *Resolver
|
||||
}
|
||||
|
||||
// Valid reports whether underlying value is non-nil.
|
||||
// Valid reports whether v's underlying value is non-nil.
|
||||
func (v ResolverView) Valid() bool { return v.ж != nil }
|
||||
|
||||
// AsStruct returns a clone of the underlying value which aliases no memory with
|
||||
|
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
//go:generate go run tailscale.com/cmd/cloner -clonefunc=false -type=Persist
|
||||
|
||||
// View returns a readonly view of Persist.
|
||||
// View returns a read-only view of Persist.
|
||||
func (p *Persist) View() PersistView {
|
||||
return PersistView{ж: p}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ type PersistView struct {
|
||||
ж *Persist
|
||||
}
|
||||
|
||||
// Valid reports whether underlying value is non-nil.
|
||||
// Valid reports whether v's underlying value is non-nil.
|
||||
func (v PersistView) Valid() bool { return v.ж != nil }
|
||||
|
||||
// AsStruct returns a clone of the underlying value which aliases no memory with
|
||||
|
@@ -29,8 +29,8 @@ import (
|
||||
var (
|
||||
// ErrManaged is the error returned when attempting to modify a managed preference.
|
||||
ErrManaged = errors.New("cannot modify a managed preference")
|
||||
// ErrReadOnly is the error returned when attempting to modify a readonly preference.
|
||||
ErrReadOnly = errors.New("cannot modify a readonly preference")
|
||||
// ErrReadOnly is the error returned when attempting to modify a read-only preference.
|
||||
ErrReadOnly = errors.New("cannot modify a read-only preference")
|
||||
)
|
||||
|
||||
// metadata holds type-agnostic preference metadata.
|
||||
|
@@ -20,7 +20,7 @@ import (
|
||||
|
||||
//go:generate go run tailscale.com/cmd/cloner -clonefunc=false -type=Prefs,AutoUpdatePrefs,AppConnectorPrefs
|
||||
|
||||
// View returns a readonly view of Prefs.
|
||||
// View returns a read-only view of Prefs.
|
||||
func (p *Prefs) View() PrefsView {
|
||||
return PrefsView{ж: p}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ type PrefsView struct {
|
||||
ж *Prefs
|
||||
}
|
||||
|
||||
// Valid reports whether underlying value is non-nil.
|
||||
// Valid reports whether v's underlying value is non-nil.
|
||||
func (v PrefsView) Valid() bool { return v.ж != nil }
|
||||
|
||||
// AsStruct returns a clone of the underlying value which aliases no memory with
|
||||
@@ -132,7 +132,7 @@ var _PrefsViewNeedsRegeneration = Prefs(struct {
|
||||
Persist *persist.Persist
|
||||
}{})
|
||||
|
||||
// View returns a readonly view of AutoUpdatePrefs.
|
||||
// View returns a read-only view of AutoUpdatePrefs.
|
||||
func (p *AutoUpdatePrefs) View() AutoUpdatePrefsView {
|
||||
return AutoUpdatePrefsView{ж: p}
|
||||
}
|
||||
@@ -148,7 +148,7 @@ type AutoUpdatePrefsView struct {
|
||||
ж *AutoUpdatePrefs
|
||||
}
|
||||
|
||||
// Valid reports whether underlying value is non-nil.
|
||||
// Valid reports whether v's underlying value is non-nil.
|
||||
func (v AutoUpdatePrefsView) Valid() bool { return v.ж != nil }
|
||||
|
||||
// AsStruct returns a clone of the underlying value which aliases no memory with
|
||||
@@ -186,7 +186,7 @@ var _AutoUpdatePrefsViewNeedsRegeneration = AutoUpdatePrefs(struct {
|
||||
Apply prefs.Item[opt.Bool]
|
||||
}{})
|
||||
|
||||
// View returns a readonly view of AppConnectorPrefs.
|
||||
// View returns a read-only view of AppConnectorPrefs.
|
||||
func (p *AppConnectorPrefs) View() AppConnectorPrefsView {
|
||||
return AppConnectorPrefsView{ж: p}
|
||||
}
|
||||
@@ -202,7 +202,7 @@ type AppConnectorPrefsView struct {
|
||||
ж *AppConnectorPrefs
|
||||
}
|
||||
|
||||
// Valid reports whether underlying value is non-nil.
|
||||
// Valid reports whether v's underlying value is non-nil.
|
||||
func (v AppConnectorPrefsView) Valid() bool { return v.ж != nil }
|
||||
|
||||
// AsStruct returns a clone of the underlying value which aliases no memory with
|
||||
|
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
//go:generate go run tailscale.com/cmd/cloner -clonefunc=false -type=TestPrefs,TestBundle,TestValueStruct,TestGenericStruct,TestPrefsGroup -tags=test
|
||||
|
||||
// View returns a readonly view of TestPrefs.
|
||||
// View returns a read-only view of TestPrefs.
|
||||
func (p *TestPrefs) View() TestPrefsView {
|
||||
return TestPrefsView{ж: p}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ type TestPrefsView struct {
|
||||
ж *TestPrefs
|
||||
}
|
||||
|
||||
// Valid reports whether underlying value is non-nil.
|
||||
// Valid reports whether v's underlying value is non-nil.
|
||||
func (v TestPrefsView) Valid() bool { return v.ж != nil }
|
||||
|
||||
// AsStruct returns a clone of the underlying value which aliases no memory with
|
||||
@@ -117,7 +117,7 @@ var _TestPrefsViewNeedsRegeneration = TestPrefs(struct {
|
||||
Group TestPrefsGroup
|
||||
}{})
|
||||
|
||||
// View returns a readonly view of TestBundle.
|
||||
// View returns a read-only view of TestBundle.
|
||||
func (p *TestBundle) View() TestBundleView {
|
||||
return TestBundleView{ж: p}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ type TestBundleView struct {
|
||||
ж *TestBundle
|
||||
}
|
||||
|
||||
// Valid reports whether underlying value is non-nil.
|
||||
// Valid reports whether v's underlying value is non-nil.
|
||||
func (v TestBundleView) Valid() bool { return v.ж != nil }
|
||||
|
||||
// AsStruct returns a clone of the underlying value which aliases no memory with
|
||||
@@ -172,7 +172,7 @@ var _TestBundleViewNeedsRegeneration = TestBundle(struct {
|
||||
Nested *TestValueStruct
|
||||
}{})
|
||||
|
||||
// View returns a readonly view of TestValueStruct.
|
||||
// View returns a read-only view of TestValueStruct.
|
||||
func (p *TestValueStruct) View() TestValueStructView {
|
||||
return TestValueStructView{ж: p}
|
||||
}
|
||||
@@ -188,7 +188,7 @@ type TestValueStructView struct {
|
||||
ж *TestValueStruct
|
||||
}
|
||||
|
||||
// Valid reports whether underlying value is non-nil.
|
||||
// Valid reports whether v's underlying value is non-nil.
|
||||
func (v TestValueStructView) Valid() bool { return v.ж != nil }
|
||||
|
||||
// AsStruct returns a clone of the underlying value which aliases no memory with
|
||||
@@ -225,7 +225,7 @@ var _TestValueStructViewNeedsRegeneration = TestValueStruct(struct {
|
||||
Value int
|
||||
}{})
|
||||
|
||||
// View returns a readonly view of TestGenericStruct.
|
||||
// View returns a read-only view of TestGenericStruct.
|
||||
func (p *TestGenericStruct[T]) View() TestGenericStructView[T] {
|
||||
return TestGenericStructView[T]{ж: p}
|
||||
}
|
||||
@@ -241,7 +241,7 @@ type TestGenericStructView[T ImmutableType] struct {
|
||||
ж *TestGenericStruct[T]
|
||||
}
|
||||
|
||||
// Valid reports whether underlying value is non-nil.
|
||||
// Valid reports whether v's underlying value is non-nil.
|
||||
func (v TestGenericStructView[T]) Valid() bool { return v.ж != nil }
|
||||
|
||||
// AsStruct returns a clone of the underlying value which aliases no memory with
|
||||
@@ -280,7 +280,7 @@ func _TestGenericStructViewNeedsRegeneration[T ImmutableType](TestGenericStruct[
|
||||
}{})
|
||||
}
|
||||
|
||||
// View returns a readonly view of TestPrefsGroup.
|
||||
// View returns a read-only view of TestPrefsGroup.
|
||||
func (p *TestPrefsGroup) View() TestPrefsGroupView {
|
||||
return TestPrefsGroupView{ж: p}
|
||||
}
|
||||
@@ -296,7 +296,7 @@ type TestPrefsGroupView struct {
|
||||
ж *TestPrefsGroup
|
||||
}
|
||||
|
||||
// Valid reports whether underlying value is non-nil.
|
||||
// Valid reports whether v's underlying value is non-nil.
|
||||
func (v TestPrefsGroupView) Valid() bool { return v.ж != nil }
|
||||
|
||||
// AsStruct returns a clone of the underlying value which aliases no memory with
|
||||
|
@@ -83,7 +83,7 @@ type StructMapView[K MapKeyType, T views.ViewCloner[T, V], V views.StructView[T]
|
||||
ж *StructMap[K, T]
|
||||
}
|
||||
|
||||
// StructMapViewOf returns a readonly view of m.
|
||||
// StructMapViewOf returns a read-only view of m.
|
||||
// It is used by [tailscale.com/cmd/viewer].
|
||||
func StructMapViewOf[K MapKeyType, T views.ViewCloner[T, V], V views.StructView[T]](m *StructMap[K, T]) StructMapView[K, T, V] {
|
||||
return StructMapView[K, T, V]{m}
|
||||
|
Reference in New Issue
Block a user