Skip to content

Ability to compare 2 folders #1

@omegascorp

Description

@omegascorp

Go Folder Compare lib should be able to do a shallow compare of 2 folders.

Structs:
FolderSnapshot - should keep a snapshot of a folder

Functions:

// Creates folder snapshot using folder path
func CreateSnapshot(folderPath string) *FolderSnapshot
// Shows diff between 2 folders as a floating point number between 0 and 1, 0 - no diff, 1 - compleatly different
func CompareSnapshots(firstFolder, secondFolder) float32

Code example:

var firstSnapshot *FolderSnapshot
var secondSnapshot *FolderSnapshot
firstSnapshot = folderCompare.CreateSnapshot("src/something")
secondSnapshot = folderCompare.CreateSnapshot("src/something/else")
folderCompare.CompareSnapshots(firstFolder * FolderSnapshot, secondFolder * FolderSnapshots)

Coding style requirement: Fast assignment construction (:=) should not be used.

During project design, we should keep in mind that in the future it should be able to compare with multiple folders and find the best match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions