MCPcopy Index your code
hub / github.com/bytebase/bytebase / getStore

Function getStore

backend/tests/sql_query_data_source_test.go:167–175  ·  view source on GitHub ↗
(t *testing.T, srv *server.Server)

Source from the content-addressed store, hash-verified

165}
166
167func getStore(t *testing.T, srv *server.Server) *store.Store {
168 t.Helper()
169 field := reflect.ValueOf(srv).Elem().FieldByName("store")
170 stores, ok := reflect.NewAt(field.Type(), unsafe.Pointer(field.UnsafeAddr())).Elem().Interface().(*store.Store)
171 if !ok {
172 t.Fatal("failed to access server store")
173 }
174 return stores
175}

Calls 2

FatalMethod · 0.80
TypeMethod · 0.45

Tested by

no test coverage detected