568func (b *BaseComponent) IsAPage() bool { return false }
569func (b *BaseComponent) GetName() string { return b.Name }
570func (b *BaseComponent) GetAssetList() []string { return make([]string, 0) }
571func (b *BaseComponent) GetAsset(name string) ([]byte, error) { return nil, nil }572func (b *BaseComponent) GetJS() template.JS { return b.JS }
573func (b *BaseComponent) GetCSS() template.CSS { return b.CSS }
574func (b *BaseComponent) GetCallbacks() types.Callbacks { return b.Callbacks }
471//
472// You can define your own "Content-Type" header also, after this function call
473// Doesn't implements resuming (by range), use ctx.SendFile instead
474func (ctx *Context) ServeContent(content io.ReadSeeker, filename string, modtime time.Time, gzipCompression bool) error {475 if modified, err := ctx.CheckIfModifiedSince(modtime); !modified && err == nil {
476 ctx.WriteNotModified()
477 return nil
804func (def *DefaultAction) BtnAttribute() template.HTML { return def.Attr }
805func (def *DefaultAction) BtnClass() template.HTML { return "" }
806func (def *DefaultAction) ExtContent(ctx *context.Context) template.HTML { return def.Ext }
807func (def *DefaultAction) FooterContent(ctx *context.Context) template.HTML { return def.Footer } 808func (def *DefaultAction) GetCallbacks() context.Node { return context.Node{} }
809
810var _ Action = (*DefaultAction)(nil)
803func (def *DefaultAction) Js() template.JS { return def.JS }
804func (def *DefaultAction) BtnAttribute() template.HTML { return def.Attr }
805func (def *DefaultAction) BtnClass() template.HTML { return "" }
806func (def *DefaultAction) ExtContent(ctx *context.Context) template.HTML { return def.Ext } 807func (def *DefaultAction) FooterContent(ctx *context.Context) template.HTML { return def.Footer }
808func (def *DefaultAction) GetCallbacks() context.Node { return context.Node{} }
809
782func (def *NilAction) BtnAttribute() template.HTML { return "" }
783func (def *NilAction) BtnClass() template.HTML { return "" }
784func (def *NilAction) ExtContent(ctx *context.Context) template.HTML { return "" }
785func (def *NilAction) FooterContent(ctx *context.Context) template.HTML { return "" } 786func (def *NilAction) GetCallbacks() context.Node { return context.Node{} }
787
788type Actions []Action
Unused parameters in functions or methods should be replaced with _
(underscore) or removed.
Functions or methods with unused parameters can be a symptom of unfinished
refactoring or a bug. If an unused parameter is present, it should be named _
(underscore) to avoid raising this issue and better readability.
func abc(unused string) {
fmt.Println("Not using any passed params.")
}
func abc(_ string) {
fmt.Println("Not using any passed params.")
}
func abc() {
fmt.Println("Not using any passed params.")
}