export struct members for signature benchmark

i assume unexported fields are skipped on purpose, but computing the signature
of a struct with no exported fields in a benchmark seems sort of pointless and
also panics. export the fields so that we actually compute their signature, and
prevent panic'ing on an empty struct.

fixes:

	panic: dbus: invalid type struct { b uint8; i int32; t uint64; s string }

	goroutine 12 [running]:
	github.com/godbus/dbus/v5.getSignature({0x74c3c0, 0x6bbf60}, 0xc0000aaed8)
		/home/mischief/src/go-dbus/sig.go:106 +0xa25
	github.com/godbus/dbus/v5.getSignature({0x74c3c0, 0x6822e0}, 0xc0000aaed8)
		/home/mischief/src/go-dbus/sig.go:110 +0x60c
	github.com/godbus/dbus/v5.SignatureOf({0x8fcb40?, 0xc000193f40?, 0x518452?})
		/home/mischief/src/go-dbus/sig.go:37 +0x50
	github.com/godbus/dbus/v5.BenchmarkGetSignatureLong(0xc000148788)
		/home/mischief/src/go-dbus/sig_test.go:68 +0x36
	testing.(*B).runN(0xc000148788, 0x1)
		/usr/lib/go/src/testing/benchmark.go:193 +0xf8
	testing.(*B).run1.func1()
		/usr/lib/go/src/testing/benchmark.go:215 +0x4e
	created by testing.(*B).run1 in goroutine 1
		/usr/lib/go/src/testing/benchmark.go:208 +0x90

when executing:

	go test -v -bench BenchmarkGetSignatureLong -run ^$ .
1 file changed
tree: 4ed1c3235271fb97427e3e69eb18b5ec9b2f52c1
  1. .github/
  2. _examples/
  3. introspect/
  4. prop/
  5. testdata/
  6. .cirrus.yml
  7. .golangci.yml
  8. auth.go
  9. auth_anonymous.go
  10. auth_external.go
  11. auth_sha1.go
  12. call.go
  13. conn.go
  14. conn_darwin.go
  15. conn_linux_test.go
  16. conn_other.go
  17. conn_test.go
  18. conn_unix.go
  19. conn_windows.go
  20. CONTRIBUTING.md
  21. dbus.go
  22. dbus_test.go
  23. decoder.go
  24. decoder_test.go
  25. default_handler.go
  26. doc.go
  27. encoder.go
  28. encoder_test.go
  29. escape.go
  30. escape_test.go
  31. examples_test.go
  32. exec_command_test.go
  33. export.go
  34. export_test.go
  35. go.mod
  36. go.sum
  37. homedir.go
  38. LICENSE
  39. MAINTAINERS
  40. match.go
  41. match_test.go
  42. message.go
  43. message_test.go
  44. object.go
  45. object_test.go
  46. proto_fuzz_test.go
  47. proto_test.go
  48. README.md
  49. SECURITY.md
  50. sequence.go
  51. sequence_test.go
  52. sequential_handler.go
  53. sequential_handler_test.go
  54. server_interfaces.go
  55. server_interfaces_test.go
  56. sig.go
  57. sig_test.go
  58. store_test.go
  59. transport_darwin.go
  60. transport_generic.go
  61. transport_nonce_tcp.go
  62. transport_nonce_tcp_test.go
  63. transport_tcp.go
  64. transport_tcp_test.go
  65. transport_unix.go
  66. transport_unix_test.go
  67. transport_unixcred_dragonfly.go
  68. transport_unixcred_freebsd.go
  69. transport_unixcred_linux.go
  70. transport_unixcred_netbsd.go
  71. transport_unixcred_openbsd.go
  72. transport_zos.go
  73. variant.go
  74. variant_lexer.go
  75. variant_parser.go
  76. variant_test.go
README.md

Build Status

dbus

dbus is a simple library that implements native Go client bindings for the D-Bus message bus system.

Features

  • Complete native implementation of the D-Bus message protocol
  • Go-like API (channels for signals / asynchronous method calls, Goroutine-safe connections)
  • Subpackages that help with the introspection / property interfaces

Installation

This packages requires Go 1.20 or later. It can be installed by running the command below:

go get github.com/godbus/dbus/v5

Usage

The complete package documentation and some simple examples are available at pkg.go.dev. Also, the _examples directory gives a short overview over the basic usage.

Projects using godbus

  • fyne a cross platform GUI in Go inspired by Material Design.
  • fynedesk a full desktop environment for Linux/Unix using Fyne.
  • go-bluetooth provides a bluetooth client over bluez dbus API.
  • iwd go bindings for the internet wireless daemon “iwd”.
  • notify provides desktop notifications over dbus into a library.
  • playerbm a bookmark utility for media players.
  • rpic lightweight web app and RESTful API for managing a Raspberry Pi

Please note that the API is considered unstable for now and may change without further notice.

License

go.dbus is available under the Simplified BSD License; see LICENSE for the full text.

Nearly all of the credit for this library goes to github.com/guelfey/go.dbus.