fix: correct build errors and clean up code

This commit is contained in:
Castor Regex 2025-08-25 10:15:39 -05:00 committed by Jeff Carr
parent c39a2f31e6
commit 0b2ec9ce15
7 changed files with 23 additions and 22 deletions

View File

@ -11,8 +11,8 @@ verbose: goimports vet
GO111MODULE=off go install -v -x \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
build: goimports vet
GO111MODULE=off go build -v -x \
build: goimports
GO111MODULE=off go build \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
install: goimports vet

10
add.go
View File

@ -28,10 +28,10 @@ func addFile(filename string) (*chatpb.Chats, error) {
logDir := filepath.Dir(filename)
// Iterate through the structure to inline all external content.
for _, chat := range logData.GetChats() {
for _, entry := range chat.GetEntries() {
for _, chat := range logData.Chats {
for _, entry := range chat.Entries {
// Inline main content from ContentFile
if contentFile := entry.GetContentFile(); contentFile != "" {
if contentFile := entry.ContentFile; contentFile != "" {
contentPath := filepath.Join(logDir, contentFile)
contentBytes, err := os.ReadFile(contentPath)
if err != nil {
@ -42,9 +42,9 @@ func addFile(filename string) (*chatpb.Chats, error) {
}
// Inline snippet content from snippet files
if snippets := entry.GetSnippets(); snippets != nil {
if snippets := entry.Snippets; snippets != nil {
for _, snippet := range snippets {
if snippetFile := snippet.GetFilename(); snippetFile != "" {
if snippetFile := snippet.Filename; snippetFile != "" {
snippetPath := filepath.Join(logDir, snippetFile)
contentBytes, err := os.ReadFile(snippetPath)
if err != nil {

1
junk Normal file
View File

@ -0,0 +1 @@

BIN
regex Executable file

Binary file not shown.