<commit_before>package backend

import (
	"github.com/UserStack/ustackd/backends"
	"github.com/UserStack/ustackd/client"
)

const (
	Memory = iota
	Remote
)

var Type int
var backend backends.Abstract

func build() backends.Abstract {
	if Type == Memory {
		backend, _ := backends.NewSqliteBackend(":memory:")
		return &backend
	} else {
		backend, _ := client.Dial("127.0.0.1:7654")
		return backend
	}
}

func Current() backends.Abstract {
	if backend == nil {<commit_msg>Fix backend deref issues. Refs #1.<commit_after>package backend

import (
	"github.com/UserStack/ustackd/backends"
	"github.com/UserStack/ustackd/client"
)

const (
	Memory = iota
	Remote
)

var Type int
var backend backends.Abstract

func build() (backend backends.Abstract) {
	if Type == Memory {
		b, err := backends.NewSqliteBackend(":memory:")
		if err == nil {
			backend = &b
		}
	} else {
		backend, _ = client.Dial("127.0.0.1:7654")
	}
	return
}

func Current() backends.Abstract {
	if backend == nil {
{'fraction_non_alphanumeric': 0.1350253807106599, 'fraction_numerical': 0.02131979695431472, 'mean_word_length': 3.9054726368159205, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4966220', 'n_tokens_mistral': 379, 'n_tokens_neox': 359, 'n_words': 81}