<commit_before>package gocache

import (
	"fmt"
	"time"
)

type DataObject struct {
	Data      string
	Timestamp time.Time
	Expiry    int64
}

var INMEM map[string]DataObject

func init() {
	INMEM = make(map[string]DataObject)
}
func SetData(key, data string, exp ...int64) {
	temp := DataObject{}
	temp.Data = data
	temp.Timestamp = time.Now()
	if len(exp) > 0 {
		temp.Expiry = exp[0]
	}
	INMEM[key] = temp
}

func GetData(key string) (string, bool) {
	retstr := ""
	retbool := false
	if v, ok := INMEM[key]; ok {
		retstr = v.Data
		retbool = true
		if INMEM[key].Expiry > 0 && time.Now().Sub(INMEM[key].Timestamp).Nanoseconds() >= INMEM[key].Expiry*1000000 {
			retstr = ""
			retbool = false
		}

	}
	return retstr, retbool
}

<commit_msg>made inmem variable not exportable<commit_after>package gocache

import (
	"time"
)

type DataObject struct {
	Data      string
	Timestamp time.Time
	Expiry    int64
}

var inmem map[string]DataObject

func init() {
	inmem = make(map[string]DataObject)
}
func SetData(key, data string, exp ...int64) {
	temp := DataObject{}
	temp.Data = data
	temp.Timestamp = time.Now()
	if len(exp) > 0 {
		temp.Expiry = exp[0]
	}
	inmem[key] = temp
}

func GetData(key string) (string, bool) {
	retstr := ""
	retbool := false
	if v, ok := inmem[key]; ok {
		retstr = v.Data
		retbool = true
		if inmem[key].Expiry > 0 && time.Now().Sub(inmem[key].Timestamp).Nanoseconds() >= inmem[key].Expiry*1000000 {
			retstr = ""
			retbool = false
		}

	}
	return retstr, retbool
}


{'fraction_non_alphanumeric': 0.14513981358189082, 'fraction_numerical': 0.018641810918774968, 'mean_word_length': 3.4865671641791045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1392591', 'n_tokens_mistral': 632, 'n_tokens_neox': 588, 'n_words': 139}