impactsense-parser 0.1.1

Multi-language static analysis: parse codebases into an in-memory dependency graph for impact analysis
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Go standard-library import paths (from `go list std` at embed time).
use std::collections::HashSet;
use std::sync::OnceLock;

fn stdlib_paths() -> &'static HashSet<String> {
    static SET: OnceLock<HashSet<String>> = OnceLock::new();
    SET.get_or_init(|| {
        include_str!("go_stdlib_paths.txt")
            .lines()
            .map(|l| l.trim().to_string())
            .filter(|l| !l.is_empty())
            .collect()
    })
}

pub fn is_go_stdlib_import(import_path: &str) -> bool {
    stdlib_paths().contains(import_path.trim())
}