noassets.go 723 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (C) 2021 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at https://mozilla.org/MPL/2.0/.
  6. //+build noassets
  7. package auto
  8. import (
  9. "bytes"
  10. "compress/gzip"
  11. "github.com/syncthing/syncthing/lib/assets"
  12. )
  13. func Assets() map[string]assets.Asset {
  14. // Return a minimal index.html and nothing else, to allow the trivial
  15. // test to pass.
  16. buf := new(bytes.Buffer)
  17. gw := gzip.NewWriter(buf)
  18. _, _ = gw.Write([]byte("<html></html>"))
  19. _ = gw.Flush()
  20. return map[string]assets.Asset{
  21. "default/index.html": {
  22. Gzipped: true,
  23. Content: buf.String(),
  24. },
  25. }
  26. }