<commit_before>// +build linux

package resource

import (
	"errors"
	"fmt"

	"github.com/coreos/go-systemd/dbus"
	"github.com/coreos/go-systemd/util"
)

// Service type is a resource which manages
// services on a GNU/Linux system running with systemd
type Service struct {
	BaseResource

	// If true then enable the service during boot-time
	Enable bool `luar:"enable"`

	// Systemd unit name
	unit string `luar:"-"`
}

// NewService creates a new resource for managing services
// using systemd on a GNU/Linux system
func NewService(name string) (Resource, error) {
	s := &Service{
		BaseResource: BaseResource{
			Name:  name,
			Type:  "service",
			State: StateRunning,
		},
		Enable: true,
		unit:   fmt.Sprintf("%s.service", name),
	}

	return s, nil<commit_msg>resource: init Before and After fields of Service type<commit_after>// +build linux

package resource

import (
	"errors"
	"fmt"

	"github.com/coreos/go-systemd/dbus"
	"github.com/coreos/go-systemd/util"
)

// Service type is a resource which manages
// services on a GNU/Linux system running with systemd
type Service struct {
	BaseResource

	// If true then enable the service during boot-time
	Enable bool `luar:"enable"`

	// Systemd unit name
	unit string `luar:"-"`
}

// NewService creates a new resource for managing services
// using systemd on a GNU/Linux system
func NewService(name string) (Resource, error) {
	s := &Service{
		BaseResource: BaseResource{
			Name:   name,
			Type:   "service",
			State:  StateRunning,
			After:  make([]string, 0),
			Before: make([]string, 0),
		},
		Enable: true,
		unit:   fmt.Sprintf("%s.service", name),
	}

	return s, nil
{'fraction_non_alphanumeric': 0.11861313868613138, 'fraction_numerical': 0.0012165450121654502, 'mean_word_length': 3.582172701949861, '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': '1027426', 'n_tokens_mistral': 570, 'n_tokens_neox': 527, 'n_words': 179}