<commit_before>package main

import (
	"fmt"

	"github.com/hoffie/larasync/api"
	"github.com/hoffie/larasync/repository"
)

const (
	// PrivateKeySize is the size of the key used for signing.
	PrivateKeySize = repository.PrivateKeySize
	// PublicKeySize ist the size of the key used to verify the signature.
	PublicKeySize = repository.PublicKeySize
	// EncryptionKeySize is the key size used for encryption purposes.
	EncryptionKeySize = repository.EncryptionKeySize
)

// clientFor returns the Client which is configured to communicate
// with the given server repository.
func clientFor(r *repository.Repository) (*api.Client, error) {
	sc, err := r.StateConfig()
	if err != nil {
		return nil, fmt.Errorf("Error: unable to load state config (%s)", err)
	}
	if sc.DefaultServer == "" {
		return nil, fmt.Errorf("Error: no default server configured (state)")
	}
	privKey, err := r.GetSigningPrivateKey()
	if err != nil {
		return nil, fmt.Errorf("Error: unable to get signing private key (%s)", err)
	}
	client := api.NewClient(sc.DefaultServer)
	client.SetSigningPrivateKey(privKey)

	return client, nil
}<commit_msg>cmd/lara: fix double 'Error:' in messages<commit_after>package main

import (
	"fmt"

	"github.com/hoffie/larasync/api"
	"github.com/hoffie/larasync/repository"
)

const (
	// PrivateKeySize is the size of the key used for signing.
	PrivateKeySize = repository.PrivateKeySize
	// PublicKeySize ist the size of the key used to verify the signature.
	PublicKeySize = repository.PublicKeySize
	// EncryptionKeySize is the key size used for encryption purposes.
	EncryptionKeySize = repository.EncryptionKeySize
)

// clientFor returns the Client which is configured to communicate
// with the given server repository.
func clientFor(r *repository.Repository) (*api.Client, error) {
	sc, err := r.StateConfig()
	if err != nil {
		return nil, fmt.Errorf("unable to load state config (%s)", err)
	}
	if sc.DefaultServer == "" {
		return nil, fmt.Errorf("no default server configured (state)")
	}
	privKey, err := r.GetSigningPrivateKey()
	if err != nil {
		return nil, fmt.Errorf("unable to get signing private key (%s)", err)
	}
	client := api.NewClient(sc.DefaultServer)
	client.SetSigningPrivateKey(privKey)

	return client, nil
}
{'fraction_non_alphanumeric': 0.10769915442812639, 'fraction_numerical': 0.0, 'mean_word_length': 4.429951690821256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '4374354', 'n_tokens_mistral': 698, 'n_tokens_neox': 682, 'n_words': 226}